insert into table 插入多条数据
2011-08-17 12:05
148 查看
方法1:
insert into `ttt`
select '001','语文' union all
select '002','数学' union all
select '003','英语';
方法2:
INSERT INTO tab_comp VALUES(item1, price1, qty1),
(item2, price2, qty2),
(item3, price3, qty3);
方法3:
INSERT INTO tab_comp(item1, price1, qty1) SELECT item1, price1, qty1 FROM tab_cc;
insert into `ttt`
select '001','语文' union all
select '002','数学' union all
select '003','英语';
方法2:
INSERT INTO tab_comp VALUES(item1, price1, qty1),
(item2, price2, qty2),
(item3, price3, qty3);
方法3:
INSERT INTO tab_comp(item1, price1, qty1) SELECT item1, price1, qty1 FROM tab_cc;
相关文章推荐
- insert into table 插入多条数据
- insert into table 插入多条数据
- insert into table 插入多条数据
- insert into table 插入多条数据
- insert into table 插入多条数据
- mysql插入数据后返回自增ID的方法,last_insert_id(),selectkey
- 【转载】在mysql中获取insert插入数据的id的方法SELECT LAST_INSERT_ID();
- 第四章 第一节:插入数据INSERT
- oracle informix 插入insert多条数据 记录
- insert into table 插入多条数据
- 并发insert情况下会发生重复的数据插入问题
- JDBC Insert语句插入Oracle数据库返回数据主键
- insert into插入表,插入多条数据,sql插入表,插入多条数据,数据库插入表,插入多条数据
- mysql5.7基础 insert 表中含有自动增长的字段,插入数据时用NULL
- mybatis的insert语句插入数据时的返回值
- insert一句话实现插入一条数据并且返回这条数据的某列
- mybatis 做 insert操作的时候返回插入的那条数据的id
- 用一条insert语句来插入多行数据
- SQL语言使用insert语句向数据库表格中插入或添加新的数据行
- 【转】把一个表的数据插入到另一个表:INSERT INTO SELECT / SELECT INTO