Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 ANSI JOIN

Author  Topic 

kiran
Starting Member

30 Posts

Posted - 2002-02-28 : 14:12:46
How do I write the following query in ANSI style ?

SELECT <<columnlist>>
FROM table1,table2,table3,table4
WHERE table1.c1 = table2.c1
AND table1.c2 = table3.c1
AND table1.c3 = table4.c1

Thanks for your help

JamesT
Yak Posting Veteran

97 Posts

Posted - 2002-02-28 : 14:47:51
SELECT <<Columnlist>>
FROM TABLE1 T1
INNER JOIN TABLE2 T2 ON T1.C1 = T2.C1
INNER JOIN TABLE3 T3 ON T1.C1 = T3.C1
INNER JOIN TABLE4 T4 ON T1.C1 = T4.C1

The aliasing of the tale names (e.g., T2, T3, etc) is just a short cut to typing everything out.

Go to Top of Page

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2002-03-01 : 14:25:38
Kiran:

Your query is ANSI compliant.

Go to Top of Page
   

- Advertisement -