Re: Get the offset of a tuple inside a table

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Get the offset of a tuple inside a table
Дата
Msg-id AANLkTi=5YO49BCjay+E07cKFH=23_J3KA-gnO1Y7Q_p1@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Get the offset of a tuple inside a table  (Pei He <hepeimail@gmail.com>)
Список pgsql-hackers
On Tue, Sep 21, 2010 at 10:58 PM, Pei He <hepeimail@gmail.com> wrote:
> Hi Tom,
> The bitmapset works for me.
>
> I want to implement the operator for the following query:
>
> Select * from a left join b on a.id = b.id order by b.id;
>
> In a left outer join, I want the tuples that have matches in the inner table
> appear first. So, the order by clause is need.

Why can't you just write SELECT * FROM a LEFT JOIN b ON a.id = b.id
ORDER BY b.id NULLS FIRST?  "I want my query results in a different
order" is almost never something that requires modifying the source
code.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: snapshot generation broken
Следующее
От: Dennis Björklund
Дата:
Сообщение: Documentation, window functions