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
 SQL Server Development (2000)
 Multiple ON statement inside a join

Author  Topic 

daniel.newman@bis-web.net
Yak Posting Veteran

71 Posts

Posted - 2001-08-07 : 08:32:27
Is it possible to join table a to table b on two columns?

SELECT * FROM tableA A
INNER JOIN tableB B ON A.column1 = B.column1 AND A.column2 = B.column2

Or would a double join do the same thing

SELECT * FROM tableA A
INNER JOIN tableB B ON A.column1 = B.column1 INNER JOIN tableB C B.column2 = C.column2

Sounds simple, so a quick answer will be fine :-)

Thanks,

Daniel Newman.



Edited by - daniel.newman@bis-web.net on 08/07/2001 08:33:34
   

- Advertisement -