I have two tables and need top copy one to another INSERT INTO tbl_new SELECT FROM tbl_old
they both have 3 exact same columns, but tbl_new has 4th column called “type” how can i populate it in the same query.
I need to copy row from tbl_old and assign value to cell “type”
INSERT INTO tbl_new SELECT FROM tbl_old, (type) values (floor(rand() * 10))
does not work
Say
tbl_oldhas two columns andtbl_newhas threeSuppose you want to populate colC with sum of colA and colB values. You can use this:
In your example: