<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Interesting Observation of ON Clause on LEFT JOIN &#8211; How ON Clause affects Resultset in LEFT JOIN</title>
	<atom:link href="http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:36:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-192041</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Thu, 10 Nov 2011 04:24:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-192041</guid>
		<description><![CDATA[This is not i Expect....
By the by,... EmpNo and BadgeID can&#039;t be equal all the time..
 
Any way, .. thanks.... for your try..

I need to get TextDescription from Master table for the corresponding ID in transaction table.
Thats all the concept.. if the corresponding ID is not available in Master table.,, we have to omit that record While fetching from Trasaction table.

Thats it...........]]></description>
		<content:encoded><![CDATA[<p>This is not i Expect&#8230;.<br />
By the by,&#8230; EmpNo and BadgeID can&#8217;t be equal all the time..</p>
<p>Any way, .. thanks&#8230;. for your try..</p>
<p>I need to get TextDescription from Master table for the corresponding ID in transaction table.<br />
Thats all the concept.. if the corresponding ID is not available in Master table.,, we have to omit that record While fetching from Trasaction table.</p>
<p>Thats it&#8230;&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghav</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-191631</link>
		<dc:creator><![CDATA[Raghav]]></dc:creator>
		<pubDate>Wed, 09 Nov 2011 14:54:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-191631</guid>
		<description><![CDATA[How do you get &#039;NULL&#039; in the Description column if there isn&#039;t such record in that column. May be you want the result as:

EmpNo   Description
--------------------------
1             Mixing
2             Simplex


If it is so, then you can try out the query this way:

SELECT a.EmpNo , b.Description FROM #temp1 a
INNER JOIN #temp2 b ON a.EmpNo = b.BadgeID



Regards,
Raghav]]></description>
		<content:encoded><![CDATA[<p>How do you get &#8216;NULL&#8217; in the Description column if there isn&#8217;t such record in that column. May be you want the result as:</p>
<p>EmpNo   Description<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1             Mixing<br />
2             Simplex</p>
<p>If it is so, then you can try out the query this way:</p>
<p>SELECT a.EmpNo , b.Description FROM #temp1 a<br />
INNER JOIN #temp2 b ON a.EmpNo = b.BadgeID</p>
<p>Regards,<br />
Raghav</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-191491</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Wed, 09 Nov 2011 09:48:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-191491</guid>
		<description><![CDATA[Create table #temp1(EmpNo int Identity Not Null, BadgeID int Null )
Insert into #temp1 values (1)
Insert into #temp1 values (NULL)
Insert into #temp1 values (3)

Create table #temp2(BadgeID int Identity Not NUll, Description varchar(20) Not NUll)
Insert into #temp2 values ( &#039;Mixing&#039;)
Insert into #temp2 values ( &#039;Simplex&#039;)
Insert into #temp2 values ( &#039;Combing&#039;)
Insert into #temp2 values ( &#039;Adidas&#039;)

Delete from #temp2 where Description = &#039;Combing&#039;

--------------------------------------------

Select * from #temp1 

Result:
EmpNo	BadgeID
1	1
2	NULL
3	3
---------------------------------------------

Select * from #temp2 

Result :
BadgeID	Description
1	Mixing
2	Simplex
4	Adidas
--------------------------------------------

Select a.EmpNo , b.Description   from #temp1 a
left outer join 
#temp2 b on a.BadgeID = b.BadgeID 

Result:
EmpNo	Description
1	Mixing
2	NULL
3	NULL

From the above Result, i want to eliminate the last record  EmpNo = 3, since its Corresponding BadgeID 3 is not in table #temp2.

I want the result as :

EmpNo	Description
1	Mixing
2	NULL]]></description>
		<content:encoded><![CDATA[<p>Create table #temp1(EmpNo int Identity Not Null, BadgeID int Null )<br />
Insert into #temp1 values (1)<br />
Insert into #temp1 values (NULL)<br />
Insert into #temp1 values (3)</p>
<p>Create table #temp2(BadgeID int Identity Not NUll, Description varchar(20) Not NUll)<br />
Insert into #temp2 values ( &#8216;Mixing&#8217;)<br />
Insert into #temp2 values ( &#8216;Simplex&#8217;)<br />
Insert into #temp2 values ( &#8216;Combing&#8217;)<br />
Insert into #temp2 values ( &#8216;Adidas&#8217;)</p>
<p>Delete from #temp2 where Description = &#8216;Combing&#8217;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Select * from #temp1 </p>
<p>Result:<br />
EmpNo	BadgeID<br />
1	1<br />
2	NULL<br />
3	3<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Select * from #temp2 </p>
<p>Result :<br />
BadgeID	Description<br />
1	Mixing<br />
2	Simplex<br />
4	Adidas<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Select a.EmpNo , b.Description   from #temp1 a<br />
left outer join<br />
#temp2 b on a.BadgeID = b.BadgeID </p>
<p>Result:<br />
EmpNo	Description<br />
1	Mixing<br />
2	NULL<br />
3	NULL</p>
<p>From the above Result, i want to eliminate the last record  EmpNo = 3, since its Corresponding BadgeID 3 is not in table #temp2.</p>
<p>I want the result as :</p>
<p>EmpNo	Description<br />
1	Mixing<br />
2	NULL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-191480</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 09 Nov 2011 09:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-191480</guid>
		<description><![CDATA[Generic approach

update t1
set t1.col=t2.col
from table1 as t1 inner join table2 as t2 on t1.keycol=t2.keycol
where t2.somecol=]]></description>
		<content:encoded><![CDATA[<p>Generic approach</p>
<p>update t1<br />
set t1.col=t2.col<br />
from table1 as t1 inner join table2 as t2 on t1.keycol=t2.keycol<br />
where t2.somecol=</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-191477</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 09 Nov 2011 09:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-191477</guid>
		<description><![CDATA[What does this return?

SELECT *
FROM Table1 t1
INNER JOIN Table2 t2 ON t1.ID = t2.ID]]></description>
		<content:encoded><![CDATA[<p>What does this return?</p>
<p>SELECT *<br />
FROM Table1 t1<br />
INNER JOIN Table2 t2 ON t1.ID = t2.ID</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-191318</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Wed, 09 Nov 2011 04:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-191318</guid>
		<description><![CDATA[How to handle the above logic with optimized query.

Thank you

Regards
janani.S]]></description>
		<content:encoded><![CDATA[<p>How to handle the above logic with optimized query.</p>
<p>Thank you</p>
<p>Regards<br />
janani.S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-187047</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 13:02:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-187047</guid>
		<description><![CDATA[Yes i tried..  it returns everything....

My Issue is , i want to eliminate records if ID is not available in table t2

Note : t1.Id is Nullable Column in table t1
t2.Id is Not Nullable and Identity Column in table t2]]></description>
		<content:encoded><![CDATA[<p>Yes i tried..  it returns everything&#8230;.</p>
<p>My Issue is , i want to eliminate records if ID is not available in table t2</p>
<p>Note : t1.Id is Nullable Column in table t1<br />
t2.Id is Not Nullable and Identity Column in table t2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-187042</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 12:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-187042</guid>
		<description><![CDATA[Did you try this?

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID WHERE t2.Flag is null]]></description>
		<content:encoded><![CDATA[<p>Did you try this?</p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID WHERE t2.Flag is null</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-187018</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 12:12:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-187018</guid>
		<description><![CDATA[hai Pinal… 

Please Give me Solution for the below Problem!!!!!!!!

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null

———-

How To Hanle the Query…

If i want want to eliminate Resultant Record when t2.Id is Not Available in Table t2 and t1.Id is Not Null from the above Query Result



Note : t1.Id is Nullable Column in table t1
t2.Id is Not Nullable and Identity Column in table t2]]></description>
		<content:encoded><![CDATA[<p>hai Pinal… </p>
<p>Please Give me Solution for the below Problem!!!!!!!!</p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null</p>
<p>———-</p>
<p>How To Hanle the Query…</p>
<p>If i want want to eliminate Resultant Record when t2.Id is Not Available in Table t2 and t1.Id is Not Null from the above Query Result</p>
<p>Note : t1.Id is Nullable Column in table t1<br />
t2.Id is Not Nullable and Identity Column in table t2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-186845</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 07:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-186845</guid>
		<description><![CDATA[hai Pinal... 

Please Give me Solution for the below Problem!!!!!!!!

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null

———-

How To Hanle the Query...

If i want want to eliminate Resultant Record when t2.Id is Not Available in Table t2 and t1.Id is Not Null from the above Query Result]]></description>
		<content:encoded><![CDATA[<p>hai Pinal&#8230; </p>
<p>Please Give me Solution for the below Problem!!!!!!!!</p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null</p>
<p>———-</p>
<p>How To Hanle the Query&#8230;</p>
<p>If i want want to eliminate Resultant Record when t2.Id is Not Available in Table t2 and t1.Id is Not Null from the above Query Result</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janani</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-186836</link>
		<dc:creator><![CDATA[janani]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 07:01:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-186836</guid>
		<description><![CDATA[SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null

----------

How To Hanle Left Join ...
If i want want to eliminate Resultant Record when t2.Id is Not Available in Table t2 from the above Query Result]]></description>
		<content:encoded><![CDATA[<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null</p>
<p>&#8212;&#8212;&#8212;-</p>
<p>How To Hanle Left Join &#8230;<br />
If i want want to eliminate Resultant Record when t2.Id is Not Available in Table t2 from the above Query Result</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jroughgarden</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-175074</link>
		<dc:creator><![CDATA[jroughgarden]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 15:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-175074</guid>
		<description><![CDATA[David Bridge, you are right. Pinal Dave is a hero! 

But we do all make mistakes with grammar and punctuation at times, especially when there is no spelling or grammar checker. For example, you failed to punctuate the word &#039;however&#039; correctly in your comment and misplaced the period as well. Your sentende should have read:

(Effect can also be an adjective depending on how it is used; however, affect is always a verb os it is doing something to something else.)

So it goes. I think the meaning of your comment as well as the meaning of Pinal Dave&#039;s title are completely clear. So I would call your comment and mine both nitpicks.

:&gt;)]]></description>
		<content:encoded><![CDATA[<p>David Bridge, you are right. Pinal Dave is a hero! </p>
<p>But we do all make mistakes with grammar and punctuation at times, especially when there is no spelling or grammar checker. For example, you failed to punctuate the word &#8216;however&#8217; correctly in your comment and misplaced the period as well. Your sentende should have read:</p>
<p>(Effect can also be an adjective depending on how it is used; however, affect is always a verb os it is doing something to something else.)</p>
<p>So it goes. I think the meaning of your comment as well as the meaning of Pinal Dave&#8217;s title are completely clear. So I would call your comment and mine both nitpicks.</p>
<p>:&gt;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-174965</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 09:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-174965</guid>
		<description><![CDATA[Thank you so much.

I am very very glad to have your email and comment. I value and appreciate it 100%. Only friends give feedback.]]></description>
		<content:encoded><![CDATA[<p>Thank you so much.</p>
<p>I am very very glad to have your email and comment. I value and appreciate it 100%. Only friends give feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davidbridge</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-174955</link>
		<dc:creator><![CDATA[davidbridge]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 09:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-174955</guid>
		<description><![CDATA[A very small grammatical error but sadly as it is in the title, I thought I would bring it to your attention. 

I realise that English is not your main language and totally admire your ability to master it and write such fantastic articles using it. I hope that you are not offended to be informed of this slight error in what is a very misunderstood area of the language.

“SQL SERVER – Interesting Observation of ON Clause on LEFT JOIN – How ON Clause Effects Resultset in LEFT JOIN”

Should be

“SQL SERVER – Interesting Observation of ON Clause on LEFT JOIN – How ON Clause affects Resultset in LEFT JOIN”

The difference being the word Affects (Effects). 
Affect is a verb where one thing affects another.
Effect is a noun where we see the effect that one thing had on the other.
(Effect can also be an adjective depending on how it is used however affect is always a verb os it is doing something to something else).

I think you have done a really good job of explaining the issue. I have often had to explain this weird behaviour to DB developers but in future I think I will simply point them at your example.

Regards

Dave]]></description>
		<content:encoded><![CDATA[<p>A very small grammatical error but sadly as it is in the title, I thought I would bring it to your attention. </p>
<p>I realise that English is not your main language and totally admire your ability to master it and write such fantastic articles using it. I hope that you are not offended to be informed of this slight error in what is a very misunderstood area of the language.</p>
<p>“SQL SERVER – Interesting Observation of ON Clause on LEFT JOIN – How ON Clause Effects Resultset in LEFT JOIN”</p>
<p>Should be</p>
<p>“SQL SERVER – Interesting Observation of ON Clause on LEFT JOIN – How ON Clause affects Resultset in LEFT JOIN”</p>
<p>The difference being the word Affects (Effects).<br />
Affect is a verb where one thing affects another.<br />
Effect is a noun where we see the effect that one thing had on the other.<br />
(Effect can also be an adjective depending on how it is used however affect is always a verb os it is doing something to something else).</p>
<p>I think you have done a really good job of explaining the issue. I have often had to explain this weird behaviour to DB developers but in future I think I will simply point them at your example.</p>
<p>Regards</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shruti</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-132858</link>
		<dc:creator><![CDATA[Shruti]]></dc:creator>
		<pubDate>Wed, 04 May 2011 12:45:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-132858</guid>
		<description><![CDATA[Thanks Pinal..

Your article saved me from committing a big mistake while writing a query.

Thanks for the good work]]></description>
		<content:encoded><![CDATA[<p>Thanks Pinal..</p>
<p>Your article saved me from committing a big mistake while writing a query.</p>
<p>Thanks for the good work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prashant</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-89709</link>
		<dc:creator><![CDATA[prashant]]></dc:creator>
		<pubDate>Mon, 27 Sep 2010 09:36:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-89709</guid>
		<description><![CDATA[hi 

i have one query 
i want to update the data in table 1 based on certain condition which must be satisfy by table 2 how should i do this please give small example
waiting for u r reply

thanks]]></description>
		<content:encoded><![CDATA[<p>hi </p>
<p>i have one query<br />
i want to update the data in table 1 based on certain condition which must be satisfy by table 2 how should i do this please give small example<br />
waiting for u r reply</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Priyadarshi Alok</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-81196</link>
		<dc:creator><![CDATA[Priyadarshi Alok]]></dc:creator>
		<pubDate>Thu, 22 Jul 2010 05:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-81196</guid>
		<description><![CDATA[good job]]></description>
		<content:encoded><![CDATA[<p>good job</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Roughgarden</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-77457</link>
		<dc:creator><![CDATA[Jeffrey Roughgarden]]></dc:creator>
		<pubDate>Wed, 23 Jun 2010 19:00:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-77457</guid>
		<description><![CDATA[For the inner join case, the results and the actual query plans are identical, so there should be no difference in performance.

That being said, my stylistic preference is to put filters in the WHERE clause. Then when I see filters in a JOIN clause, I expect to see an outer join and a reason for the filter being there instead of its normal location.]]></description>
		<content:encoded><![CDATA[<p>For the inner join case, the results and the actual query plans are identical, so there should be no difference in performance.</p>
<p>That being said, my stylistic preference is to put filters in the WHERE clause. Then when I see filters in a JOIN clause, I expect to see an outer join and a reason for the filter being there instead of its normal location.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: suleman</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-77162</link>
		<dc:creator><![CDATA[suleman]]></dc:creator>
		<pubDate>Mon, 21 Jun 2010 14:10:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-77162</guid>
		<description><![CDATA[Hi Pinal,
it would be great if you answer separately.

point 1 )

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag = 1

you saying that in above select statement , rows from table2 will be filtered where flag = 1 (i.e.  1 , 2 . 8 will be there ) before joining. Now left join of table1 and table2( rows: 1,2,8) will be there and will get the required result.

Right ? 

point 2 )
what if 

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t1.Flag = 1

i could not get correct result based on previous assumption.
please explain]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
it would be great if you answer separately.</p>
<p>point 1 )</p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag = 1</p>
<p>you saying that in above select statement , rows from table2 will be filtered where flag = 1 (i.e.  1 , 2 . 8 will be there ) before joining. Now left join of table1 and table2( rows: 1,2,8) will be there and will get the required result.</p>
<p>Right ? </p>
<p>point 2 )<br />
what if </p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t1.Flag = 1</p>
<p>i could not get correct result based on previous assumption.<br />
please explain</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-74609</link>
		<dc:creator><![CDATA[Tom]]></dc:creator>
		<pubDate>Thu, 03 Jun 2010 15:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-74609</guid>
		<description><![CDATA[This really good article with easy explaination. I got lot of confusion on joins populating wiered result, when I join more then 2 tables and put condition on (ON clause) and where clause.]]></description>
		<content:encoded><![CDATA[<p>This really good article with easy explaination. I got lot of confusion on joins populating wiered result, when I join more then 2 tables and put condition on (ON clause) and where clause.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bandhu Banerjee</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-71662</link>
		<dc:creator><![CDATA[Bandhu Banerjee]]></dc:creator>
		<pubDate>Wed, 19 May 2010 19:23:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-71662</guid>
		<description><![CDATA[I find your site too good. This particular post realy helped me clear my confusions related to ON clause and WHERE clause in LEFT JOINS.]]></description>
		<content:encoded><![CDATA[<p>I find your site too good. This particular post realy helped me clear my confusions related to ON clause and WHERE clause in LEFT JOINS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-63817</link>
		<dc:creator><![CDATA[Amit]]></dc:creator>
		<pubDate>Fri, 26 Mar 2010 19:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-63817</guid>
		<description><![CDATA[Ok ... I got the answer for the question I asked .. try this query and you will see the difference

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID 
		 AND (t1.flag = 2 and t2.Flag = 1)

In an outer join, the join filters (expressions) that you specify in the ON clause determine which rows of the subordinate table join to the dominant (or outer) table. The dominant table, by definition, returns all its rows in the joined table. That is, a join filter in the ON clause has no effect on the dominant table.

If the ON clause specifies a join filter on the dominant table, the database server joins only those dominant table rows that meet the criterion of the join filter to rows in the subordinate table. The joined result contains all rows from the dominant table.]]></description>
		<content:encoded><![CDATA[<p>Ok &#8230; I got the answer for the question I asked .. try this query and you will see the difference</p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID<br />
		 AND (t1.flag = 2 and t2.Flag = 1)</p>
<p>In an outer join, the join filters (expressions) that you specify in the ON clause determine which rows of the subordinate table join to the dominant (or outer) table. The dominant table, by definition, returns all its rows in the joined table. That is, a join filter in the ON clause has no effect on the dominant table.</p>
<p>If the ON clause specifies a join filter on the dominant table, the database server joins only those dominant table rows that meet the criterion of the join filter to rows in the subordinate table. The joined result contains all rows from the dominant table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-63816</link>
		<dc:creator><![CDATA[Amit]]></dc:creator>
		<pubDate>Fri, 26 Mar 2010 19:00:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-63816</guid>
		<description><![CDATA[If your explaination is correct , why folling query comes back with all rows from the table1 

SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID 
	AND (t1.flag = 1 and t2.Flag = 1)

As per your explaination , it should bring only 

1,2,4,6]]></description>
		<content:encoded><![CDATA[<p>If your explaination is correct , why folling query comes back with all rows from the table1 </p>
<p>SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID<br />
	AND (t1.flag = 1 and t2.Flag = 1)</p>
<p>As per your explaination , it should bring only </p>
<p>1,2,4,6</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilesh Molankar</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-60253</link>
		<dc:creator><![CDATA[Nilesh Molankar]]></dc:creator>
		<pubDate>Wed, 27 Jan 2010 05:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-60253</guid>
		<description><![CDATA[Hi Mayur,
I think the article 
http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/
by Pinal himself gives more explanation on such scenarios. Please read that it may be helpful.
It did help me a lot.

The results that you get by the query
SELECT *
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null

Are correct and as expected.

NOTE : 
1. Both conditions are in the ON clause so result will be created based on both.
2. Since no WHERE clause all records of Left table will be part of result set.

Step 1: 
t1.ID = t2.ID

Results : 
1	First	1	1	First	1
2	Second	1	2	Second	1
3	Third	2	3	Third	2
4	Fourth	1	NULL	NULL	NULL
5	Fifth	2	NULL	NULL	NULL
6	Sixth	1	NULL	NULL	NULL
7	Seventh	2	NULL	NULL	NULL

Step 2 :
AND t2.Flag is null
as per this condition no rows of Table2 from step 1 qualifies hence you see all values as NULL for Table2.
Hope this helps.

--Nilesh]]></description>
		<content:encoded><![CDATA[<p>Hi Mayur,<br />
I think the article<br />
<a href="http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/" rel="nofollow">http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/</a><br />
by Pinal himself gives more explanation on such scenarios. Please read that it may be helpful.<br />
It did help me a lot.</p>
<p>The results that you get by the query<br />
SELECT *<br />
FROM Table1 t1<br />
LEFT JOIN Table2 t2 ON t1.ID = t2.ID AND t2.Flag is null</p>
<p>Are correct and as expected.</p>
<p>NOTE :<br />
1. Both conditions are in the ON clause so result will be created based on both.<br />
2. Since no WHERE clause all records of Left table will be part of result set.</p>
<p>Step 1:<br />
t1.ID = t2.ID</p>
<p>Results :<br />
1	First	1	1	First	1<br />
2	Second	1	2	Second	1<br />
3	Third	2	3	Third	2<br />
4	Fourth	1	NULL	NULL	NULL<br />
5	Fifth	2	NULL	NULL	NULL<br />
6	Sixth	1	NULL	NULL	NULL<br />
7	Seventh	2	NULL	NULL	NULL</p>
<p>Step 2 :<br />
AND t2.Flag is null<br />
as per this condition no rows of Table2 from step 1 qualifies hence you see all values as NULL for Table2.<br />
Hope this helps.</p>
<p>&#8211;Nilesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanjay</title>
		<link>http://blog.sqlauthority.com/2009/03/15/sql-server-interesting-observation-of-on-clause-on-left-join-how-on-clause-effects-resultset-in-left-join/#comment-60097</link>
		<dc:creator><![CDATA[sanjay]]></dc:creator>
		<pubDate>Fri, 22 Jan 2010 13:29:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3755#comment-60097</guid>
		<description><![CDATA[hi sir,


I saw your blog it&#039;s really very nice.
nd this article is very nice and it contain clear explanation.]]></description>
		<content:encoded><![CDATA[<p>hi sir,</p>
<p>I saw your blog it&#8217;s really very nice.<br />
nd this article is very nice and it contain clear explanation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

