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

Поиск
Список
Период
Сортировка
От Adam Rosi-Kessel
Тема Re: ORDER BY does not work as expected with multiple joins
Дата
Msg-id 43C7C5D1.9030600@rosi-kessel.org
обсуждение исходный текст
Ответ на Re: ORDER BY does not work as expected with multiple joins  (Michael Glaesemann <grzm@myrealbox.com>)
Ответы Re: ORDER BY does not work as expected with multiple joins  (Michael Glaesemann <grzm@myrealbox.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: ORDER BY does not work as expected with multiple joins
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: ORDER BY does not work as expected with multiple joins