I have cat table in a2 database I want to insert into id, img columns from different tables with different database
INSERT INTO a2.cat (id, img) SELECT id FROM topshop_test.product , SELECT name FROM topshop_test.product-images ;
I have cat table in a2 database I want to insert into id, img columns from different tables with different database
INSERT INTO a2.cat (id, img) SELECT id FROM topshop_test.product , SELECT name FROM topshop_test.product-images ;
I think you need to look into using a
JOIN
for this:This assumes the product-images table has a productid field that links to the product table.