Example: Identity Columns and INSERT … SELECT
Assume that column_1 of table_1 is a GENERATED BY DEFAULT identity column.
INSERT INTO table_2 (column_1, column_2, column_3)
VALUES (111,111,111);
INSERT INTO table_2 (column_1, column_2, column_3)
VALUES (222,222,222);
INSERT INTO table_2 (column_1, column_2, column_3)
VALUES (1,333,333);
INSERT INTO table_1 (column_1, column_2, column_3)
SELECT * FROM table_2;
Check the result of the insert operations by selecting all the rows from table_1.
SELECT *
FROM table_1;
*** Query completed. 3rows found. 3 columns returned.
*** Total elapsed time was 1 second.
column_1 column_2 column_3
--------- --------- ---------
111 111 111
222 222 222
1 333 333