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 2008 Forums
 Transact-SQL (2008)
 INNER JOIN vs LEFT JOIN

Author  Topic 

OLEG007
Starting Member

1 Post

Posted - 2011-06-21 : 20:50:35
some one asked me recently
based on a simple example during a interview,
for example a simple customer to invoince table example:
how would one return values matching the invoices to the customers
via id and fk relationship, I told them a simple INNER join based on a matching id to fk id, his reply to me was that would work, but a LEFT join with a is not NULL condition is more optimal in a large database, I disputed this but to no avail, this was at a large hedgefund.. witha SVP level guy so it was no use, any oppinions or am I missing something here ??
thanks

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2011-06-21 : 21:34:55
an SVP at a hedge fund writing SQL queries? I'd steer well clear of that outfit.


elsasoft.org
Go to Top of Page

theboyholty
Posting Yak Master

226 Posts

Posted - 2011-06-22 : 07:25:33
Id say the guy was an idiot (but not to his face).

---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk The official unofficial website of Bury Football Club
Go to Top of Page

denis_the_thief
Aged Yak Warrior

596 Posts

Posted - 2011-06-22 : 11:22:07
I tried an example just now both ways. Tables were 1.5 million and 45 million records. I got identical execution paths. I'm begining to wonder if that fellow has some sort of a complex.
Go to Top of Page
   

- Advertisement -