方式一:insert into tableName(column,column...) values(str,str...); 方式二:insert into tableName set column=str,column=str...;
子查询插入:insert into tableName(column,column...) 子查询
(1)insert into tableName(column,column...) select str,str....;
(2)insert into tableName(column,column...) select str,str.... from tableName where 条件;
使用union进行多行插入:
insert into tableName
select str,str... union
select str,str... union
....
sql92语法: update tableName 别名1,tableName 别名2 ... set 别名1.column=value,别名2.column=value.... where 连接条件【表1和表2的连接条件】 and 筛选条件; sql99语法: update tableName 别名1 inner|left|right join tableName 别名2 on 连接条件 set 别名1=value.... where 连接条件
sql92语法: delete 别名1,别名2 ... from tableName 别名1,tableName 别名2... where 连接条件【表1和表2的连接条件】 and 筛选条件; sql99语法: delete 别名1,别名2 ... from tableName 别名1 inner|left|right join tableName 别名2 on 连接条件 where 连接条件 truncate语法:truncate table tableName;
原文:https://www.cnblogs.com/huangrenhui/p/12456250.html