What query would insert the selected columns, for a desired value, from a table into another table?
Before Query
table1=>Colums(A,B,C)
row1(a,b,1)
row2(c,d,0)
row3(e,f,1)
table2=>Columns(id,A,B)
After Query
table1 is unchanged.
table2(id,A,B)
row1(id,a,b)
row2(id,e,f)
I need to insert in table2 all the rows from table1 where 'C=1', C may equal 1 in multiple records.
INSERT INTO TABLE2(A,B,C)
SELECT A,B,C
FROM TABLE1
WHERE C = 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With