第四章数据更新

数据更新

插入数据

l  Insert  into(ignore) 表名 values(‘数据’,数据,数据,数据)

Ignore:违背唯一约束不进行插入

除有默认值列之外,全部列都要添加

字符型,日期使用单引号

修改数据

l  Update [ignore] 表名 set 列名=’数据’  [ where 条件]

删除数据

l  Delete [ignore] from 表名 [where 条件]

多表删除数据

l  Delete [ignore] 表名1,表名2  from 表名1,表名2  [where 条件]

[where 条件]注意各自都需要删除条件,并不是满足全部条件才删除

例子:delete 表名1,表名2 from 表名1,表名2  where 表名1.name=’wo’;

此语句将会删除表1 name=’wo’的所有记录,而表名2 的内容将会被全部删除

l  Delete [ignore] from 表名1,表名2 using 表名1,表名1  [where 条件]

posted @ 2018-12-11 00:30  汪啊汪  阅读(73)  评论(0)    收藏  举报