I have a query that I need to pass the output from it into aother query. Can this be down all in code?
arep
Pass result of a SQL query to another SQL query
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Nitesh KejriwalRank #253 · 9.9K reputationPosted Oct 15, 2012, 11:07 AM EDT
SELECT * FROM tbl1 WHERE tbl1.col1 IN (SELECT col2 FROM tbl2)
SELECT tbl1.* FROM tbl1 JOIN tbl2
ON tbl1.col1 = tbl2.col2