How do I write a SQL query to find out what the group ID is and then display list of Options from that Group ID.
I can do it by two queries, for example:
//Get the group ID
SELECT option_group_id FROM options WHERE id =14122
//Now get a list of OptionID from that group ID
SELECT id, name FROM options WHERE option_group_id = 999
How do I put this into 1 query?
Neither. You use an inner join against the same table: