I have a little problem, I’d like to INSERT INTO myTable (id_product, id_tag) combined values
I know the method will be:
INSERT INTO myTable values (value1a, value1b),(value2a, value2b)
But problem is I have 934 products and 5 tags = 4670 combinations. So manually it will takes a ages to insert it! I know what id’s has a products:
SELECT id_product FROM prodTable
So can anybody direct me what I should do (procedures, functions – I newer used it before, until today?)
I think you need a cartesian join:
SELECT will select all products id, combined with all tags id, and rows will be inserted in myTable.