All Forums Analytics
macktd 23 posts Joined 09/12
13 Mar 2013
Please give syntax of scalar subquery to join three tables

Please give syntax of scalar subquery to join three tables
regards,-mack

Tags:
KS42982 137 posts Joined 12/12
14 Mar 2013

As you haven't mentioned the table names or columns to join them, I have put generic query below. You can change it as per your requirements. Also, not sure why you want to use scalar subquery instead of outer joins.
SELECT t1.one
,(SELECT t2.two FROM TEST2 t2 WHERE t1.one=t2.two) t21
,(SELECT t3.three FROM TEST3 t3 WHERE t1.one=t3.three) t31
FROM TEST1 t1

 

macktd 23 posts Joined 09/12
14 Mar 2013

Thank you very much ks42982,
 
Regards,
-mack
 
 

You must sign in to leave a comment.