Ghilas BELHADJ
Ghilas BELHADJ

Reputation: 14096

Insert values returned from SQL query to another table

The returned structure of an SQL query is: id | label

I've created a table with the same structure, how to insert the returned lines to this new table.

Upvotes: 0

Views: 49

Answers (2)

Maksim Khaitovich
Maksim Khaitovich

Reputation: 4792

insert into SecondTable (id, label) select id, label from OriginalTable;

Upvotes: 0

Barmar
Barmar

Reputation: 780984

INSERT INTO new_table (id, label)
<put select query here>

Upvotes: 2

Related Questions