<?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; Challenge &#8211; Puzzle &#8211; Why does RIGHT JOIN Exists</title>
	<atom:link href="http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: VINAY</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-390695</link>
		<dc:creator><![CDATA[VINAY]]></dc:creator>
		<pubDate>Mon, 10 Dec 2012 12:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-390695</guid>
		<description><![CDATA[I also agree with this . This is one imp reason when u join multiple tables...ROJ needed for proper result.]]></description>
		<content:encoded><![CDATA[<p>I also agree with this . This is one imp reason when u join multiple tables&#8230;ROJ needed for proper result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #006 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-389248</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #006 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 08 Dec 2012 01:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-389248</guid>
		<description><![CDATA[[...] SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists (Open)  [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists (Open)  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #005 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-384387</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #005 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 01 Dec 2012 01:31:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-384387</guid>
		<description><![CDATA[[...] SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Isaacs</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-151150</link>
		<dc:creator><![CDATA[Eric Isaacs]]></dc:creator>
		<pubDate>Wed, 27 Jul 2011 21:41:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-151150</guid>
		<description><![CDATA[Actually, you may not even need the parenthesis since the ORDER of the ON clauses actually determines the order that the tables are joined...

SELECT * FROM c
    LEFT JOIN a 
        INNER JOIN b 
        ON a.x = b.k 
    ON a.y = c.j]]></description>
		<content:encoded><![CDATA[<p>Actually, you may not even need the parenthesis since the ORDER of the ON clauses actually determines the order that the tables are joined&#8230;</p>
<p>SELECT * FROM c<br />
    LEFT JOIN a<br />
        INNER JOIN b<br />
        ON a.x = b.k<br />
    ON a.y = c.j</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Isaacs</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-151148</link>
		<dc:creator><![CDATA[Eric Isaacs]]></dc:creator>
		<pubDate>Wed, 27 Jul 2011 21:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-151148</guid>
		<description><![CDATA[You can fix it with parenthesis however...

SELECT * FROM a
INNER JOIN b ON a.x = b.k
RIGHT JOIN c ON a.y = c.j

...becomes...

SELECT * FROM
    c 
    LEFT JOIN (a INNER JOIN b ON a.x = b.k) ON a.y = c.j]]></description>
		<content:encoded><![CDATA[<p>You can fix it with parenthesis however&#8230;</p>
<p>SELECT * FROM a<br />
INNER JOIN b ON a.x = b.k<br />
RIGHT JOIN c ON a.y = c.j</p>
<p>&#8230;becomes&#8230;</p>
<p>SELECT * FROM<br />
    c<br />
    LEFT JOIN (a INNER JOIN b ON a.x = b.k) ON a.y = c.j</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kamesh shah</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-106235</link>
		<dc:creator><![CDATA[Kamesh shah]]></dc:creator>
		<pubDate>Fri, 17 Dec 2010 06:39:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-106235</guid>
		<description><![CDATA[Hi Mark,

 Very good explanation.Dont you mind may be its a silly doubt but if you make this query as left outer join still you can filter this condition in your where clause right ???

Let me know if this condition will affect any where or will give me some error.....

Thanks and regards 
kamesh shah]]></description>
		<content:encoded><![CDATA[<p>Hi Mark,</p>
<p> Very good explanation.Dont you mind may be its a silly doubt but if you make this query as left outer join still you can filter this condition in your where clause right ???</p>
<p>Let me know if this condition will affect any where or will give me some error&#8230;..</p>
<p>Thanks and regards<br />
kamesh shah</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kamesh shah</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-106231</link>
		<dc:creator><![CDATA[Kamesh shah]]></dc:creator>
		<pubDate>Fri, 17 Dec 2010 05:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-106231</guid>
		<description><![CDATA[Hi Jason ,

Reason was good that it forces me to see how practically it goes . i tried my hand to see it practical but for me it is working in reverse order 

Table1

c1	c2
1	NULL
2	2
3	3
4	4
5	5
6	6

Table2

c1	c2
2	NULL
3	2
4	NULL
5	NULL
6	6
7	NULL

Table3

c1	c2
4	NULL
5	2
6	NULL
7	2
8	NULL
9	9


select table1.c1,table2.c1,table2.c2 from table1
RIGHT OUTER JOIN table2 
on table1.c2	=	table2.c2
RIGHT OUTER JOIN table3 
on 	table2.c2=table3.c2	

select table1.c1,table2.c1,table2.c2 from table3
LEFT OUTER JOIN  table2
on table3.c2	=	table2.c2
LEFT OUTER JOIN  table1
on table1.c2	=	table2.c2


check out this both queries it gives same result?? and i think at all i can complete my task without Right outer join ..

If somewhere i m wrong correct me..

Thanks and regards
 kamesh shah]]></description>
		<content:encoded><![CDATA[<p>Hi Jason ,</p>
<p>Reason was good that it forces me to see how practically it goes . i tried my hand to see it practical but for me it is working in reverse order </p>
<p>Table1</p>
<p>c1	c2<br />
1	NULL<br />
2	2<br />
3	3<br />
4	4<br />
5	5<br />
6	6</p>
<p>Table2</p>
<p>c1	c2<br />
2	NULL<br />
3	2<br />
4	NULL<br />
5	NULL<br />
6	6<br />
7	NULL</p>
<p>Table3</p>
<p>c1	c2<br />
4	NULL<br />
5	2<br />
6	NULL<br />
7	2<br />
8	NULL<br />
9	9</p>
<p>select table1.c1,table2.c1,table2.c2 from table1<br />
RIGHT OUTER JOIN table2<br />
on table1.c2	=	table2.c2<br />
RIGHT OUTER JOIN table3<br />
on 	table2.c2=table3.c2	</p>
<p>select table1.c1,table2.c1,table2.c2 from table3<br />
LEFT OUTER JOIN  table2<br />
on table3.c2	=	table2.c2<br />
LEFT OUTER JOIN  table1<br />
on table1.c2	=	table2.c2</p>
<p>check out this both queries it gives same result?? and i think at all i can complete my task without Right outer join ..</p>
<p>If somewhere i m wrong correct me..</p>
<p>Thanks and regards<br />
 kamesh shah</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103923</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Mon, 06 Dec 2010 03:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103923</guid>
		<description><![CDATA[very good explanation,

Would you be able to come up with similar example in AdventureWorks database?]]></description>
		<content:encoded><![CDATA[<p>very good explanation,</p>
<p>Would you be able to come up with similar example in AdventureWorks database?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103922</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Mon, 06 Dec 2010 03:55:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103922</guid>
		<description><![CDATA[This is excellent answer!]]></description>
		<content:encoded><![CDATA[<p>This is excellent answer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: samira</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103631</link>
		<dc:creator><![CDATA[samira]]></dc:creator>
		<pubDate>Fri, 03 Dec 2010 20:47:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103631</guid>
		<description><![CDATA[4. dear  Matt Velic
I am a right to left language writer and i found no relationship between the language and right outer join
I think it is play with words and not a reason]]></description>
		<content:encoded><![CDATA[<p>4. dear  Matt Velic<br />
I am a right to left language writer and i found no relationship between the language and right outer join<br />
I think it is play with words and not a reason</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: samira</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103629</link>
		<dc:creator><![CDATA[samira]]></dc:creator>
		<pubDate>Fri, 03 Dec 2010 20:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103629</guid>
		<description><![CDATA[what I think is:
1. imagine you have 3 table. all join together. you need all information of middle table
so left join+ right join = full outer join 
it is more meaning full

2.dear Marc maybe it is possible to write every queries with left in diffrent ways but a complicated code is not a good code especialy when language giving you tools.

3. imagine you have 5 table joined to each other. it is useful to order tables in some way(2 parpose:1. optimization join. 2.readability of the query 3. achive correct data) so when you want use outer join in such condition, it depends which side is your table not what you prefer.]]></description>
		<content:encoded><![CDATA[<p>what I think is:<br />
1. imagine you have 3 table. all join together. you need all information of middle table<br />
so left join+ right join = full outer join<br />
it is more meaning full</p>
<p>2.dear Marc maybe it is possible to write every queries with left in diffrent ways but a complicated code is not a good code especialy when language giving you tools.</p>
<p>3. imagine you have 5 table joined to each other. it is useful to order tables in some way(2 parpose:1. optimization join. 2.readability of the query 3. achive correct data) so when you want use outer join in such condition, it depends which side is your table not what you prefer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103441</link>
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Thu, 02 Dec 2010 15:04:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103441</guid>
		<description><![CDATA[It takes a little extra syntax, but you can reverse the order if you really want to:

Symbolically, a J b RJ c =&gt; c LJ ( a J b )
And the parens are important.

In T-SQL:

SELECT * FROM a
  INNER JOIN b ON a.x = b.k
  RIGHT JOIN c ON a.y = c.j

can be rewritten without RIGHT JOIN as

SELECT *FROM c
  LEFT JOIN (
    SELECT * FROM a -- disambiguate common columns in *
      INNER JOIN b ON a.x = b.k
  ) d ON c.j = d.y

but the RIGHT JOIN is less noisy.]]></description>
		<content:encoded><![CDATA[<p>It takes a little extra syntax, but you can reverse the order if you really want to:</p>
<p>Symbolically, a J b RJ c =&gt; c LJ ( a J b )<br />
And the parens are important.</p>
<p>In T-SQL:</p>
<p>SELECT * FROM a<br />
  INNER JOIN b ON a.x = b.k<br />
  RIGHT JOIN c ON a.y = c.j</p>
<p>can be rewritten without RIGHT JOIN as</p>
<p>SELECT *FROM c<br />
  LEFT JOIN (<br />
    SELECT * FROM a &#8212; disambiguate common columns in *<br />
      INNER JOIN b ON a.x = b.k<br />
  ) d ON c.j = d.y</p>
<p>but the RIGHT JOIN is less noisy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raja</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103269</link>
		<dc:creator><![CDATA[Raja]]></dc:creator>
		<pubDate>Wed, 01 Dec 2010 09:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103269</guid>
		<description><![CDATA[Interesting!!! topic pinaldave!! I was thought about it earilier!! One of the interviewer asked me the same question long time back.I agree with Jason Yousef
&quot;if you’re joining 3 tables or more. you can’t reverse the table order when you join the 3rd table to the 2nd.&quot;
I think it is perfect answer]]></description>
		<content:encoded><![CDATA[<p>Interesting!!! topic pinaldave!! I was thought about it earilier!! One of the interviewer asked me the same question long time back.I agree with Jason Yousef<br />
&#8220;if you’re joining 3 tables or more. you can’t reverse the table order when you join the 3rd table to the 2nd.&#8221;<br />
I think it is perfect answer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – 3 Simple Puzzles – Need Your Suggestions Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103224</link>
		<dc:creator><![CDATA[SQL SERVER – 3 Simple Puzzles – Need Your Suggestions Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Wed, 01 Dec 2010 01:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103224</guid>
		<description><![CDATA[[...] SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-103005</link>
		<dc:creator><![CDATA[Mike]]></dc:creator>
		<pubDate>Tue, 30 Nov 2010 07:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-103005</guid>
		<description><![CDATA[Let&#039;s consider some Wharehouse example. I may have multiple wharehouses with different account numbers. 
Let&#039;s call them (ACC)
I&#039;ve got 2 tables, Book and Supplies,  Supplies table stores my product incomes into wharehouses and book is a parent
table for supplies.
in supplies table I&#039;m storing the following data:

Product 1    income count - 10   date: Somedate
Product 2    income count - 5   date: TheSameDate
Product 3    income count - 3   date: TheSameDate

Product 1    income count - 5   date: Somedate+2 days
Product 2    income count - 7   date: Somedate+2 days

Product 1    income count - 6   date: Somedate+4 days
Product 2    income count - 7   date: Somedate+6 days
.
.
.

first three records have the one parent record in book table where I store information about wharehouse, where income happened
and some other additional important information.

Ok now I have orders from my clients.
Orders table and OrderDetails table (Parent Child)
Orders Table stores Order date,Customer ID, plus some other information and OrderDetails table stores information about products
and amount of them that customer has ordered.

and here is a task with solution:
I want to consider some of my orders. Lets say there are 10 products in this order and now I want to know if I have corresponding
amount of each product in exaclty my wharehouse to satisfy clients order. And here is my SQL Select clause.

SELECT     OD.prOrdDetID, OD.ProdPPID, OD.OCount, ISNULL(SUM(S.RCount), 0) AS SRCount
FROM         Book AS B INNER JOIN
                      Supplies AS S ON B.Book_id = S.Book_id AND B.RecStatus = 0 AND B.db = @Acc RIGHT OUTER JOIN
                      OrderDetails AS OD
WHERE     (OD.OrderID = @OrderID)
GROUP BY OD.prOrdDetID, OD.ProdPPID, OD.OCount


prOrdDetID - Is order detail ID in OrderDetails Table
ProdPPID - is product ID
OCount - is amount of products that has been ordered by customer
SRCount - is summary of product income in my wharehouse.

As you can see, first I&#039;m taking Book and Supplies table and then I&#039;m joining to OrderDetails
if I&#039;d take OrderDetails table first and LEFT OUTER JOIN Them to Supplies + Book tables I&#039;d loose (B.db = @Acc) filter
whare db indicates wharehouse number (in which I&#039;m want to know product amount)]]></description>
		<content:encoded><![CDATA[<p>Let&#8217;s consider some Wharehouse example. I may have multiple wharehouses with different account numbers.<br />
Let&#8217;s call them (ACC)<br />
I&#8217;ve got 2 tables, Book and Supplies,  Supplies table stores my product incomes into wharehouses and book is a parent<br />
table for supplies.<br />
in supplies table I&#8217;m storing the following data:</p>
<p>Product 1    income count &#8211; 10   date: Somedate<br />
Product 2    income count &#8211; 5   date: TheSameDate<br />
Product 3    income count &#8211; 3   date: TheSameDate</p>
<p>Product 1    income count &#8211; 5   date: Somedate+2 days<br />
Product 2    income count &#8211; 7   date: Somedate+2 days</p>
<p>Product 1    income count &#8211; 6   date: Somedate+4 days<br />
Product 2    income count &#8211; 7   date: Somedate+6 days<br />
.<br />
.<br />
.</p>
<p>first three records have the one parent record in book table where I store information about wharehouse, where income happened<br />
and some other additional important information.</p>
<p>Ok now I have orders from my clients.<br />
Orders table and OrderDetails table (Parent Child)<br />
Orders Table stores Order date,Customer ID, plus some other information and OrderDetails table stores information about products<br />
and amount of them that customer has ordered.</p>
<p>and here is a task with solution:<br />
I want to consider some of my orders. Lets say there are 10 products in this order and now I want to know if I have corresponding<br />
amount of each product in exaclty my wharehouse to satisfy clients order. And here is my SQL Select clause.</p>
<p>SELECT     OD.prOrdDetID, OD.ProdPPID, OD.OCount, ISNULL(SUM(S.RCount), 0) AS SRCount<br />
FROM         Book AS B INNER JOIN<br />
                      Supplies AS S ON B.Book_id = S.Book_id AND B.RecStatus = 0 AND B.db = @Acc RIGHT OUTER JOIN<br />
                      OrderDetails AS OD<br />
WHERE     (OD.OrderID = @OrderID)<br />
GROUP BY OD.prOrdDetID, OD.ProdPPID, OD.OCount</p>
<p>prOrdDetID &#8211; Is order detail ID in OrderDetails Table<br />
ProdPPID &#8211; is product ID<br />
OCount &#8211; is amount of products that has been ordered by customer<br />
SRCount &#8211; is summary of product income in my wharehouse.</p>
<p>As you can see, first I&#8217;m taking Book and Supplies table and then I&#8217;m joining to OrderDetails<br />
if I&#8217;d take OrderDetails table first and LEFT OUTER JOIN Them to Supplies + Book tables I&#8217;d loose (B.db = @Acc) filter<br />
whare db indicates wharehouse number (in which I&#8217;m want to know product amount)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oscar Zamora</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102861</link>
		<dc:creator><![CDATA[Oscar Zamora]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 19:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102861</guid>
		<description><![CDATA[To compare what&#039;s missing from the left table only. But I always started with a LEFT OUTER JOIN to to the same from the right table.]]></description>
		<content:encoded><![CDATA[<p>To compare what&#8217;s missing from the left table only. But I always started with a LEFT OUTER JOIN to to the same from the right table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramdas</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102816</link>
		<dc:creator><![CDATA[Ramdas]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 15:59:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102816</guid>
		<description><![CDATA[For me mostly it has been LEFT JOINS. Thanks to Michael for sharing his experience in using RIGHT JOINS.]]></description>
		<content:encoded><![CDATA[<p>For me mostly it has been LEFT JOINS. Thanks to Michael for sharing his experience in using RIGHT JOINS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aasim abdullah</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102762</link>
		<dc:creator><![CDATA[aasim abdullah]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 09:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102762</guid>
		<description><![CDATA[--here is a query to support your comments:
USE AdventureWorks

SELECT PD.ProductID,PD.Name,PD.ProductNumber,PM.Name AS Product_Model,
		 PCH.StandardCost FROM Production.Product PD
LEFT OUTER JOIN Production.ProductModel PM
	ON PD.ProductModelID = PM.ProductModelID
	LEFT OUTER JOIN Production.ProductCostHistory PCH
		ON  PD.ProductID  = PCH.ProductID]]></description>
		<content:encoded><![CDATA[<p>&#8211;here is a query to support your comments:<br />
USE AdventureWorks</p>
<p>SELECT PD.ProductID,PD.Name,PD.ProductNumber,PM.Name AS Product_Model,<br />
		 PCH.StandardCost FROM Production.Product PD<br />
LEFT OUTER JOIN Production.ProductModel PM<br />
	ON PD.ProductModelID = PM.ProductModelID<br />
	LEFT OUTER JOIN Production.ProductCostHistory PCH<br />
		ON  PD.ProductID  = PCH.ProductID</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apil</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102729</link>
		<dc:creator><![CDATA[Apil]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 05:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102729</guid>
		<description><![CDATA[Right...
In this condition we need right outer join....]]></description>
		<content:encoded><![CDATA[<p>Right&#8230;<br />
In this condition we need right outer join&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Yousef</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102693</link>
		<dc:creator><![CDATA[Jason Yousef]]></dc:creator>
		<pubDate>Sun, 28 Nov 2010 22:58:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102693</guid>
		<description><![CDATA[Yep, if you&#039;re joining 3 tables or more.  you can&#039;t reverse the table order when you join the 3rd table to the 2nd.]]></description>
		<content:encoded><![CDATA[<p>Yep, if you&#8217;re joining 3 tables or more.  you can&#8217;t reverse the table order when you join the 3rd table to the 2nd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102679</link>
		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Sun, 28 Nov 2010 21:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102679</guid>
		<description><![CDATA[The only time I have used it is when optimizing a large query. One of the things I had to do was force the join order, and when you do that SQL Server stops re-writing your query. (It had been converting parts to use a RIGHT JOIN to optimize the hash joins.) So once I forced the join order performance got worse until I re-wrote it to use RIGHT JOINs. Since the join order determines which side is turned in to the hash table, and which side is run through to probe the hash table you want to make sure the smaller table is hashed.]]></description>
		<content:encoded><![CDATA[<p>The only time I have used it is when optimizing a large query. One of the things I had to do was force the join order, and when you do that SQL Server stops re-writing your query. (It had been converting parts to use a RIGHT JOIN to optimize the hash joins.) So once I forced the join order performance got worse until I re-wrote it to use RIGHT JOINs. Since the join order determines which side is turned in to the hash table, and which side is run through to probe the hash table you want to make sure the smaller table is hashed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremiah Peschka</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102629</link>
		<dc:creator><![CDATA[Jeremiah Peschka]]></dc:creator>
		<pubDate>Sun, 28 Nov 2010 13:45:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102629</guid>
		<description><![CDATA[Convenience and optimization. Just because we can write our query as a LEFT OUTER JOIN, doesn&#039;t mean that you should. SQL Server provides a RIGHT OUTER JOIN showplan operator (http://msdn.microsoft.com/en-us/library/ms190390.aspx). There are times when it&#039;s going to be most efficient to use a right outer join. Leaving that option in the language 1) gives you the same functionality in the language that you have in the optimizer and 2) supports the ANSI SQL specification. There&#039;s always a chance, in a sufficiently complex plan on a sufficiently overloaded SQL Server, that SQL Server may time out query compilation. In theory, if you specify RIGHT OUTER JOIN instead of a LEFT OUTER JOIN, your SQL could provide SQL Server with the hints it needs to create a better plan. If you ever see this situation, though, you should probably blog about it :)

No programming task requires a join, but you can also write all of your queries using syntax like SELECT * FROM a, b, c, d WHERE (a.id = b.a_id OR b.a_id IS NULL) and still have perfectly valid, well-formed, and ANSI compliant SQL.]]></description>
		<content:encoded><![CDATA[<p>Convenience and optimization. Just because we can write our query as a LEFT OUTER JOIN, doesn&#8217;t mean that you should. SQL Server provides a RIGHT OUTER JOIN showplan operator (<a href="http://msdn.microsoft.com/en-us/library/ms190390.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms190390.aspx</a>). There are times when it&#8217;s going to be most efficient to use a right outer join. Leaving that option in the language 1) gives you the same functionality in the language that you have in the optimizer and 2) supports the ANSI SQL specification. There&#8217;s always a chance, in a sufficiently complex plan on a sufficiently overloaded SQL Server, that SQL Server may time out query compilation. In theory, if you specify RIGHT OUTER JOIN instead of a LEFT OUTER JOIN, your SQL could provide SQL Server with the hints it needs to create a better plan. If you ever see this situation, though, you should probably blog about it :)</p>
<p>No programming task requires a join, but you can also write all of your queries using syntax like SELECT * FROM a, b, c, d WHERE (a.id = b.a_id OR b.a_id IS NULL) and still have perfectly valid, well-formed, and ANSI compliant SQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Velic</title>
		<link>http://blog.sqlauthority.com/2010/11/28/sql-server-challenge-puzzle-why-does-right-join-exists/#comment-102552</link>
		<dc:creator><![CDATA[Matt Velic]]></dc:creator>
		<pubDate>Sun, 28 Nov 2010 01:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10999#comment-102552</guid>
		<description><![CDATA[I think it has to do with query optimization. We tend to think Left-to-Right when reading or when making Joins on tables, but we also might be able to gain addition performance by rewriting a query in a new way, perhaps utilizing a Right Join to &quot;flip&quot; it around and test for additional performance.

And even thinking about reading Left-to-Right, maybe Right Joins are used more often in cultures that read from Right-to-Left, such as many Middle Eastern cultures?

Still, I don&#039;t use Right Joins all that often - I can&#039;t even remember the last time...]]></description>
		<content:encoded><![CDATA[<p>I think it has to do with query optimization. We tend to think Left-to-Right when reading or when making Joins on tables, but we also might be able to gain addition performance by rewriting a query in a new way, perhaps utilizing a Right Join to &#8220;flip&#8221; it around and test for additional performance.</p>
<p>And even thinking about reading Left-to-Right, maybe Right Joins are used more often in cultures that read from Right-to-Left, such as many Middle Eastern cultures?</p>
<p>Still, I don&#8217;t use Right Joins all that often &#8211; I can&#8217;t even remember the last time&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
