Re: ORDER BY does not work as expected with multiple joins - Mailing list pgsql-sql

From Adam Rosi-Kessel
Subject Re: ORDER BY does not work as expected with multiple joins
Date
Msg-id 43C7C5D1.9030600@rosi-kessel.org
Whole thread Raw
In response to Re: ORDER BY does not work as expected with multiple joins  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: ORDER BY does not work as expected with multiple joins  (Michael Glaesemann <grzm@myrealbox.com>)
List 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


pgsql-sql by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: ORDER BY does not work as expected with multiple joins
Next
From: Michael Glaesemann
Date:
Subject: Re: ORDER BY does not work as expected with multiple joins