1INSERT INTO real_table_name (person_id, given_name, family_name, title)
2 WITH temp_table AS (
3 SELECT 4, 'Ruth', 'Fox', 'Mrs' FROM dual UNION ALL
4 SELECT 5, 'Isabelle', 'Squirrel', 'Miss' FROM dual UNION ALL
5 SELECT 6, 'Justin', 'Frog', 'Master' FROM dual UNION ALL
6 SELECT 7, 'Lisa', 'Owl', 'Dr' FROM dual
7 )
8 SELECT * FROM temp_table
1-----------------------------------------------------------------
2-- OPTION 1: Insert specific values (other values will be null)
3
4-- syntax
5INSERT INTO <TABLE_NAME> (<column1>,<column2>,<column3>,...)
6VALUES (<value1>,<value2>,<value3>,...);
7
8-- example
9INSERT INTO SALES (SALE_ID,ITEM_ID,QUANTITY,AMOUNT)
10VALUES (631,13,4,59.99);
11-----------------------------------------------------------------
12-- OPTION 2: Insert a value for every field
13
14-- syntax
15INSERT INTO <TABLE_NAME> (<value1>,<value2>,...,<valueN>);
16
17-- example (SALES table only consists of 4 columns)
18INSERT INTO SALES (631,13,4,59.99);
19-----------------------------------------------------------------
1INSERT INTO my_table (col1, col2)
2SELECT 8000, 0 FROM DUAL
3UNION ALL
4SELECT 8001, 5 FROM DUAL;