Question : assigning select results to a variable


I will try to demonstrate my problem.
Say I have a query like this;

select * from Table1 where
Table1.Col1 in (Select Table2.Col2 from Table2)
or Table1.Col2 in (Select Table2.Col2 from Table2)


How can i assign "Select Table2.Col2 from Table2" part to a variable  ?

Answer : assigning select results to a variable

or may be this:

select t1.* from Table1 t1 join table2 t2 on t1.col1=t2.col2 or t1.col2=t2.col2
Random Solutions  
 
programming4us programming4us