Re: ORDER BY does not work as expected with multiple joins

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Rosi-Kessel <adam(at)rosi-kessel(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ORDER BY does not work as expected with multiple joins
Date: 2006-01-13 15:56:16
Message-ID: 25485.1137167776@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Adam Rosi-Kessel <adam(at)rosi-kessel(dot)org> writes:
> But I am curious why you think a LEFT JOIN should be used rather than RIGHT
> JOIN? I think I believe I am getting the desired set of records. When I
> substitute LEFT JOIN for RIGHT JOIN I actually get the same result. Can you
> help me understand under what conditions, in this case, I would obtain a
> different result?

Try some cases where there are IDs in the ID/name table that do not
appear in the linking table, or the other way around. If you still
like your results in those situations, then it's the right way for you.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2006-01-13 16:07:29 Re: ORDER BY does not work as expected with multiple joins
Previous Message Michael Glaesemann 2006-01-13 15:45:09 Re: ORDER BY does not work as expected with multiple joins