I have SELECT
query based on IN()
clause, where I want to feed that clause with other queries like:
SELECT *
FROM item_list
WHERE itemNAME
IN (
SELECT itemNAME
FROM item_list
WHERE itemID = '17'
AND (itemSUB ='1' OR itemSUB ='0')
ORDER BY itemSUB DESC
LIMIT 1,
SELECT itemNAME
FROM item_list
WHERE itemID = '57'
AND (itemSUB ='0' OR itemSUB ='0')
ORDER BY itemSUB DESC
LIMIT 1
)
But it errors with:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT itemNAME FROM item_list WHERE itemID = '57' AND (itemSUB ='0' OR' at line 11
User Goat CO deleted good answer: