美文网首页
MySQL常用易错语句大全(自用)

MySQL常用易错语句大全(自用)

作者: 程序员小白成长记 | 来源:发表于2020-09-07 17:02 被阅读0次

一、数据库连接

mysql --default-character-set=utf8 -u用户名 -p密码 -h主机地址 -P端口号 -D数据库名

二、查询

select * from 表名 where 字段名 = 0 order by 字段名 asc limit 0,10
其中
1,第一条记录为0
2,limit 0,10 而不是limit(0,1); 括号为错误写法

三、更新

update 数据库名 set 字段1 = "v1",字段2 = "v2",字段3 = "v3" where id = 8;
多个字段间用逗号隔开

相关文章

网友评论

      本文标题:MySQL常用易错语句大全(自用)

      本文链接:https://www.haomeiwen.com/subject/daejahtx.html