Re: Overriding natural order of query results for a subset

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: Overriding natural order of query results for a subset
Дата
Msg-id CAOzAquLQZf5UUVBK+Hbe7R3girfdTBh7bnHEPC2W0MpSqwRRnQ@mail.gmail.com
обсуждение исходный текст
Ответ на Overriding natural order of query results for a subset  (Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>)
Ответы Re: Overriding natural order of query results for a subset  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general


On Sat, May 29, 2021 at 9:15 AM Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch> wrote:
Hi

I've got a bit of a puzzle that I'm not quite sure how to approach.

Let's say I've got a table of bios, so :

create table bios (
first_name text not null,
last_name text not null,
person_title text,
person_short_bio text
)

You don't have a VIP field, so how do you know who's a VIP and who isn't much less who's a VVIP?  Is that information buried in the title and short bio fields? 

You probably need some kind order by case when .... else .... end clause, where the else clause deals with the non-VIPs, probably negating the need for a nulls last clause. 

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Overriding natural order of query results for a subset
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Overriding natural order of query results for a subset