Reputation: 1431
I want to do something like this:
My tb_b:
---------------
B | C // Columns
---------------
'y' | 'z' // row
---------------
EX: INSERT INTO tb_a(a,b,c) VALUES ('x',SELECT * from tb_b)
I want this result:
My tb_a:
-----------------
A | B | C // Columns
-----------------
'x' | 'y' | 'z' // row
-----------------
How to Insert into table a data and selected rows from tb_b?
Upvotes: 3
Views: 219
Reputation: 191819
INSERT INTO tb_a (a, b, c)
SELECT 'x', tb_b.B, tb_b.C FROM tb_b
Upvotes: 4