Q: Need a SQL query to use result from first query I have a table t1 that has fields(columns) aa,bb,cc unique combination set provides matches one isk in the same table so each record can be identified in t1 either using the combination of aa,bb,cc or by simply using isk
and I have another tablet2 which has only aa, bb, cc but has another column(field) as spo which is not in t1
So, I need to get
Select spo
from t2
where aa= t1.aa and bb= t1.bb and
       cc= t1.cc in (select aa,bb,cc from t1 where isk = <User Input>)

but this query is not working
Kindly provide a query to get the expected results
Thanks

A: SELECT spo
  FROM t2 INNER JOIN t1 ON t2.aa= t1.aa and t2.bb= t1.bb and t2.cc= t1.cc
 WHERE t1.isk = <User Input>


A: You can use tuples in expressions like :
Select spo
from t2
where (aa, bb, cc) in (select aa,bb,cc from t1 where isk = <User Input>)

