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
 General SQL Server Forums
 New to SQL Server Programming
 Joins question

Author  Topic 

Rasta Pickles
Posting Yak Master

174 Posts

Posted - 2012-05-25 : 15:06:13
Are they in any way beneficial?

I've inherited a query that has a "full outer join" part......I replaced it with "inner join" and the output was identical.

What's wrong with something along the lines of

"where customer.custno = custdel.custno and orders.custid = custdel.custno"?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-05-25 : 15:18:58
The output is identical because all of the join conditions match up in the tables. Outer joins are needed when you need the data in a particular table even if it doesn't match data in the other table.

So while it may be identical right now, it may not be in the future. Whether or not the outer join is needed is dependent upon the business requirement. It's not something we can answer for you.

And that syntax should be avoided, use JOIN syntax only for standard and support reasons.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -