Answer the question
In order to leave comments, you need to log in
How to make a subquery?
If we select only one field, and as a result of such a selection, IDs are formed, then we can do this:
SELECT `data`, `need`
FROM `tab2`
WHERE `id2` IN (SELECT `id1` FROM `tab1` WHERE...)
SELECT `id1`, `data1`, `data2`
FROM `tab1` WHERE...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question