在Oracle中,INSERT語句有以下幾種寫法:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
INSERT INTO table_name (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM source_table
WHERE condition;
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (SELECT column1, column2, column3, ... FROM source_table WHERE condition);
INSERT ALL
INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...)
INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...)
INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...)
SELECT * FROM dual;
INSERT INTO table_name (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM source_table
WHERE condition AND ROWNUM <= 10;
請根據具體的需求選擇適合的INSERT語句寫法。