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

From: Adam Rosi-Kessel <adam(at)rosi-kessel(dot)org>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ORDER BY does not work as expected with multiple joins
Date: 2006-01-13 15:22:57
Message-ID: 43C7C5D1.9030600@rosi-kessel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks for your helpful response.

Michael Glaesemann wrote:
> I don't seem to have a problem with the ordering given your data. I'm
> not sure why you're doing right and left joins, though. You might want
> to use left joins if you have NULL id1 or id2, but otherwise just plain
> JOIN should work fine. I've included both your SELECT (slightly modified
> to avoid using key words) and how I'd probably right the statement.

id1 will always have a value but id2 can be NULL. So should I do a left JOIN
on id2 but a plain JOIN on id1? Is there a disadvantage to using a left JOIN
where it is not necessary?

Adam

In response to

Responses

Browse pgsql-sql by date

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