Basically trying to fill a table with product codes from another table. The codes can be repeated in the Products table, as it has data about product sizes, however this value needs to be unique in ProductDescriptions.
I need there to be a new entry into the ProductDescriptions table every time there is a new DISTINCT product code in the Products table.
I've tried all sorts of things with no success, doesn't seem to that complex however its baffled me.
I have tried this:
INSERT INTO ProductDescriptionsbackup(ProductID) SELECT DISTINCT `PRODUCT CODE` FROM Products
However it doesn't run as it can't just take the DISTINCT values, and in the long run it doesn't update automatically, however that would be a secondary issue.
The main issue is getting the DISTINCT values into the ProductDescriptions table.
I've had a look around for answers but theres been nothing that stood out and made sense to me. Thanks in advance for any help received.