DB进阶sql
- 批量插入
1. insert into table (select * from table1);
--要保证table待插入的列和select查询的列保持一致
2.insert into table values
('1','2','3'),
('1','2','3');
-- 手动写多条数据
- 批量更新
update table1 t1 set t1.column = (select t2.column from table2 t2 where t1.id = t2.id)
--批量更一列