/*方法一*/ INSERT INTO 表名 VALUES(val1,val2,val3,...); /*方法二*/ INSERT INTO 表名 SELECT column1,column2,... FROM 表 WHERE FORGID = '0'; 如: INSERT INTO TEMPTABLE SELECT 1,2,3 FROM DUAL;
注意:
/*方法一*/ INSERT INTO 表名 (column1,column2,...) VALUES(val1,val2,val3,...); /*方法二*/ INSERT INTO 表名 (column1,column2,...) SELECT column1,column2,... FROM 表 WHERE FORGID = '0';
方式一
INSERT ALL INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3, ...) VALUES (?, ?, ?, ...) INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3, ...) VALUES (?, ?, ?, ...) INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3, ...) VALUES (?, ?, ?, ...)
方式二
2018/12/05
格式一:只插入tableName部分字段
INSERT INTO tableName (column1,column2,...) SELECT sequence.nextval,column2,... FROM tableName2
方式二的例子,见文章:oracle查询表数据并重新插入到本表
格式二:插入tableName全部字段
INSERT INTO tableName (SELECT sequence.nextval,column2,... FROM tableName2)