Say I have 3 queries. Query 1 returns a piece of information that Query 2 and Query 3 needs. Is there a way for Query 2 and Query 3 to access this piece of information from the result of Query 1?
Right now, I have Query 1 executing twice: once in Query 2 and once in Query 3. This doesn't seem efficient to me.
Is there a better way in MySQL?
EDIT 1:
For example, say Query 1 returns this:
Id
====
1
3
7
Now, Query 2 and Query 3 need 1, 3, 7 in their individual WHERE clauses.