dbTalk Databases Forums  

rewriting LEFT JOINs as RIGHT JOINs

comp.databases comp.databases


Discuss rewriting LEFT JOINs as RIGHT JOINs in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
David Cressey
 
Posts: n/a

Default Re: rewriting LEFT JOINs as RIGHT JOINs - 04-24-2008 , 06:43 AM







"Roy Hann" <specially (AT) processed (DOT) almost.meat> wrote

Quote:
"Harry Skelton" <skelton.harry (AT) gmail (DOT) com> wrote in message
news:480a17e5$0$22078$6e1ede2f (AT) read (DOT) cnntp.org...
yawnmoth wrote:
Out of curiosity, can every LEFT JOIN be rewritten as a query with
RIGHT JOINs? It seems to me that if you just take the "leftmost"
table and use that in the FROM part of a SELECT that all subsequent
LEFT JOINs would need to be RIGHT JOINs...

LEFT and RIGHT joins dictate precedence of the tables/queries. You
could
do it either way, but what data you get back will be different. If you
do
as you say, it is not merely changing the LEFT to a RIGHT, you are
changing the entire SQL query. This can cause unforeseen problems,
[...]
are actually returned.

Total nonsense.
How about making some sense out of it, Roy?

Here my two cents:
It's not clear to me that the OP understands that A LEFT JOIN B is
equivalent to B RIGHT JOIN A... But if the OP does understand that, then
obviously (s)he means more than just changing every LEFT JOIN to a RIGHT
JOIN.






Reply With Quote
  #12  
Old   
David Cressey
 
Posts: n/a

Default Re: rewriting LEFT JOINs as RIGHT JOINs - 04-24-2008 , 06:43 AM







"Roy Hann" <specially (AT) processed (DOT) almost.meat> wrote

Quote:
"Harry Skelton" <skelton.harry (AT) gmail (DOT) com> wrote in message
news:480a17e5$0$22078$6e1ede2f (AT) read (DOT) cnntp.org...
yawnmoth wrote:
Out of curiosity, can every LEFT JOIN be rewritten as a query with
RIGHT JOINs? It seems to me that if you just take the "leftmost"
table and use that in the FROM part of a SELECT that all subsequent
LEFT JOINs would need to be RIGHT JOINs...

LEFT and RIGHT joins dictate precedence of the tables/queries. You
could
do it either way, but what data you get back will be different. If you
do
as you say, it is not merely changing the LEFT to a RIGHT, you are
changing the entire SQL query. This can cause unforeseen problems,
[...]
are actually returned.

Total nonsense.
How about making some sense out of it, Roy?

Here my two cents:
It's not clear to me that the OP understands that A LEFT JOIN B is
equivalent to B RIGHT JOIN A... But if the OP does understand that, then
obviously (s)he means more than just changing every LEFT JOIN to a RIGHT
JOIN.






Reply With Quote
  #13  
Old   
David Cressey
 
Posts: n/a

Default Re: rewriting LEFT JOINs as RIGHT JOINs - 04-24-2008 , 06:43 AM




"Roy Hann" <specially (AT) processed (DOT) almost.meat> wrote

Quote:
"Harry Skelton" <skelton.harry (AT) gmail (DOT) com> wrote in message
news:480a17e5$0$22078$6e1ede2f (AT) read (DOT) cnntp.org...
yawnmoth wrote:
Out of curiosity, can every LEFT JOIN be rewritten as a query with
RIGHT JOINs? It seems to me that if you just take the "leftmost"
table and use that in the FROM part of a SELECT that all subsequent
LEFT JOINs would need to be RIGHT JOINs...

LEFT and RIGHT joins dictate precedence of the tables/queries. You
could
do it either way, but what data you get back will be different. If you
do
as you say, it is not merely changing the LEFT to a RIGHT, you are
changing the entire SQL query. This can cause unforeseen problems,
[...]
are actually returned.

Total nonsense.
How about making some sense out of it, Roy?

Here my two cents:
It's not clear to me that the OP understands that A LEFT JOIN B is
equivalent to B RIGHT JOIN A... But if the OP does understand that, then
obviously (s)he means more than just changing every LEFT JOIN to a RIGHT
JOIN.






Reply With Quote
  #14  
Old   
Roy Hann
 
Posts: n/a

Default Re: rewriting LEFT JOINs as RIGHT JOINs - 04-25-2008 , 12:03 AM



"David Cressey" <cressey73 (AT) verizon (DOT) net> wrote

Quote:
as you say, it is not merely changing the LEFT to a RIGHT, you are
changing the entire SQL query. This can cause unforeseen problems,
[...]
are actually returned.

Total nonsense.

How about making some sense out of it, Roy?

Here my two cents:
It's not clear to me that the OP understands that A LEFT JOIN B is
equivalent to B RIGHT JOIN A... But if the OP does understand that, then
obviously (s)he means more than just changing every LEFT JOIN to a RIGHT
JOIN.
On the contrary, I think the OP understood it completely, and (s)he didn't
mean more than that. It was the half-wit responder I was slamming.

Roy




Reply With Quote
  #15  
Old   
Roy Hann
 
Posts: n/a

Default Re: rewriting LEFT JOINs as RIGHT JOINs - 04-25-2008 , 12:03 AM



"David Cressey" <cressey73 (AT) verizon (DOT) net> wrote

Quote:
as you say, it is not merely changing the LEFT to a RIGHT, you are
changing the entire SQL query. This can cause unforeseen problems,
[...]
are actually returned.

Total nonsense.

How about making some sense out of it, Roy?

Here my two cents:
It's not clear to me that the OP understands that A LEFT JOIN B is
equivalent to B RIGHT JOIN A... But if the OP does understand that, then
obviously (s)he means more than just changing every LEFT JOIN to a RIGHT
JOIN.
On the contrary, I think the OP understood it completely, and (s)he didn't
mean more than that. It was the half-wit responder I was slamming.

Roy




Reply With Quote
  #16  
Old   
Roy Hann
 
Posts: n/a

Default Re: rewriting LEFT JOINs as RIGHT JOINs - 04-25-2008 , 12:03 AM



"David Cressey" <cressey73 (AT) verizon (DOT) net> wrote

Quote:
as you say, it is not merely changing the LEFT to a RIGHT, you are
changing the entire SQL query. This can cause unforeseen problems,
[...]
are actually returned.

Total nonsense.

How about making some sense out of it, Roy?

Here my two cents:
It's not clear to me that the OP understands that A LEFT JOIN B is
equivalent to B RIGHT JOIN A... But if the OP does understand that, then
obviously (s)he means more than just changing every LEFT JOIN to a RIGHT
JOIN.
On the contrary, I think the OP understood it completely, and (s)he didn't
mean more than that. It was the half-wit responder I was slamming.

Roy




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.