CreateTime--2018年2月5日11:42:15
Author:Marydon
1.往表中插入一整行数据
/*方法一*/ INSERT INTO 表名 VALUES(val1,val2,val3,...); /*方法二*/ INSERT INTO 表名 SELECT column1,column2,... FROM 表 WHERE FORGID = ‘0‘; 如: INSERT INTO TEMPTABLE SELECT 1,2,3 FROM DUAL;
注意:
2.往表中插入指定字段数据
/*方法一*/ INSERT INTO 表名 (column1,column2,...) VALUES(val1,val2,val3,...); /*方法二*/ INSERT INTO 表名 (column1,column2,...) SELECT column1,column2,... FROM 表 WHERE FORGID = ‘0‘;
3.批量插入
INSERT ALL INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3, ...) VALUES (?, ?, ?, ...) INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3, ...) VALUES (?, ?, ?, ...) INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3, ...) VALUES (?, ?, ?, ...)
原文地址:https://www.cnblogs.com/Marydon20170307/p/8416990.html
时间: 2024-10-07 12:10:45