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 2005 Forums
 Transact-SQL (2005)
 Obsolete Join syntax

Author  Topic 

George_B
Starting Member

2 Posts

Posted - 2010-02-01 : 20:14:00
Hi All

I'm attempting to convert an SQL Server Pass through query in an Access 2003 database to a SQL Server 2005 query and I'm not sure about the syntax of the join.

The query is like

select table1.field1, table1.field2, table2.field3
from table1, table2
where table1.field1 = table2.field1(+)
and ...

Is this a right outer join?

I have searched the net for and answer and haven't found much. The closest I can get is this type of join is specific to Oracle.


Thanks
George_B

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2010-02-01 : 21:20:20
Should be INNER JOIN?
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2010-02-01 : 21:37:24
Yes it is Right Outer Join.
You need to specify it like below in SQL Server:

select table1.field1, table1.field2, table2.field3
from table1 t1 RIGHT OUTER JOIN table2 t2
where t1.field1 = t2.field1


NOTE: t1 and t2 are called table aliases which are used to refer to tables by using short names

Harsh Athalye
http://www.letsgeek.net/
Go to Top of Page

George_B
Starting Member

2 Posts

Posted - 2010-02-02 : 16:36:14
Thanks for the help.
Go to Top of Page
   

- Advertisement -