Kanon情侣日常视频44部20G真实记录
日本素人情侣生活记录合集,展现真实相处模式...
2025-12-19
create database my-database1drop database my-database1create table my_table(col1 type1 [not null] [primary key],col2,type2 [not null] [primary key],...)1create table new_table like old_table1drop table my_table1列增加后不能删除。DB2中列加上后数据类型也不改变,唯一能改变的是增 加 varchar 类型的长度。
Alter table my_table add column col type1Alter table my_table add primary key(col)1Alter table my_table drop primary key(col)1create [unique] index inx on my_table(col...)1drop index inx1create view my_view as select statement1drop view my_view1选择:select * from my_table where 条件
插入:insert into my_table (field1,field2) values (value1,value2)
删除:delete from my_table where 条件
更改:update my_table set field1 = value1 where 条件
查找:select * from my_table where field1 like ‘%value1’
排序:select * from my_table order by field1,field2 [desc]
总数:select count * as totalcount form my_table
求和:select sum(field1) as sumvalue from my_table
平均:select avg(field1) as avgvalue from my_table
最大:select max(field1) as maxvalue from my_table
最小:select min(field1) as minvalue from my_table
1.链接数据库
$conn=@mysql_connect("localhost","root","root");if(!$conn){die("数据库连接失败",mysql_error())}else{echo"数据路连接成功"}1234562.选择数据库
mysql_select_db("web",$conn)13.执行 sql 语句
$query=mysql_query("select * from 表名 where 1")14.操作 sql 结果
while($row=mysql_fetch_assoc($result)){print_r($row);echo "<br>";}12345.关闭 mysql 链接
mysql_close($conn)
以上内容就是为大家推荐的常用的mysql命令大全(mysql数据库建表的完整步骤)最佳回答,如果还想搜索其他问题,请收藏本网站或点击搜索更多问题
内容来源于网络仅供参考版权声明:所有来源标注为小樱知识网www.xiaoyin02.com的内容版权均为本站所有,若您需要引用、转载,只需要注明来源及原文链接即可。
本文标题:常用的mysql命令大全(mysql数据库建表的完整步骤)
本文地址:https://www.xiaoyin02.com/shcs/118498.html
相关文章
热点文章
2021年独生子女补贴新政策是真的吗(独生子女证有有效期吗)
2021年国庆节阅兵仪式几点开始几点结束(2021年国庆节还有阅兵吗)
鼠目寸光一点红是什么生肖动物(鼠目寸光一点红)指什么生肖,紧密
k0到k9的玩法大全(强制gc的玩法和注意事项)
入土为安是什么生肖《入土为安》打一个生肖动物,词语解释
浙江12月底全面停工是真的吗(浙江什么时候放假停工)
如何做t(t怎么把p做哭)
北京口碑最差的三甲医院(北京301医院最擅长什么)