Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Re: rewriting L...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 3144 of 3253
Post > Topic >>

Re: rewriting LEFT JOINs as RIGHT JOINs

by Harry Skelton <skelton.harry@[EMAIL PROTECTED] > Apr 19, 2008 at 12:03 PM

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, 
particularly speed, temp disk space consumed (some databases are not 
smart on data retrieval and caching), and what records are actually 
returned.

Thats like saying you can omit the ORs and ANDs and rewrite the SQL as a 
SELECT/UNION query.  It is not a simple thing and it wastes man hours 
and computer time.
 




 6 Posts in Topic:
rewriting LEFT JOINs as RIGHT JOINs
yawnmoth <terra1024@[E  2008-04-19 07:10:48 
Re: rewriting LEFT JOINs as RIGHT JOINs
Harry Skelton <skelton  2008-04-19 12:03:50 
Re: rewriting LEFT JOINs as RIGHT JOINs
"Roy Hann" <  2008-04-24 12:02:39 
Re: rewriting LEFT JOINs as RIGHT JOINs
"David Cressey"  2008-04-24 11:43:57 
Re: rewriting LEFT JOINs as RIGHT JOINs
"Roy Hann" <  2008-04-25 06:03:54 
Re: rewriting LEFT JOINs as RIGHT JOINs
--CELKO-- <jcelko212@[  2008-04-22 13:13:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 22:41:55 CDT 2008.