This is a simple question for the right person. I'm trying to take distinct values from the `category` field in the `links` table and insert them into the `options` table. While I'm at it, I was going to also make the `option` field the term 'category'. I just can't seem to get it to work, though.
Here's the code I'm trying:
INSERT INTO `options` (`option`,`value`) VALUES ('category', (SELECT DISTINCT `category` FROM `links`))
This code works perfectly:
INSERT INTO `options` (`option`) SELECT DISTINCT `category` FROM `links`
So, how to add the `value` field as 'category' at the same time?