Re: Overriding natural order of query results for a subset

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
Cc: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Overriding natural order of query results for a subset
Date: 2021-05-29 14:22:21
Message-ID: CAKFQuwa2avyUMCWOx5WQhcKB_KkuO+2M1m6K--nNyC3kman-VQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday, May 29, 2021, Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
wrote:

>
> The problem is that my use-case calls for a scenario where due to protocol
> certain people may be designated as "VIP" and therefore need to appear at
> the top. In addition, protocol may dictate that those "VIP" people
> themselves may (sometimes but not always) need to be ordered in a specific
> manner.
>

Add whatever attribute(s) determine vip status to your order by clause.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael van der Kolff 2021-05-29 14:23:22 Re: Overriding natural order of query results for a subset
Previous Message Laura Smith 2021-05-29 14:15:29 Overriding natural order of query results for a subset