1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
1.插入完整数据 insert into 表名(列名) values(`````);//不指定列名默认插入完整数据 例insert into info(name,id) values ('张三',201601); 例insert into info values ('张三',201601); 插入部分数据 insert into 表名(列名) values(`````);// 例insert into info(name) values ('张三'); 插入多条记录 insert into 表名(列名) values(`````),(````),(`````);//括号里面数据,各个数据用','隔开; 输入查询数据 insert into 表名1 select * from 表名2 where id>5; 2.数据更新 update table1 set 列名=·· (where ``` )//没有where则默认所有行 例子 update info set name = '张三',id = id + 100 (where id>2016001); 3.删除 delete from table1 (where`````); 例子 delete from table1 (where id = 2016); 清空表 truncate table tabel |