pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Order by not working
Date: Tue, 16 Feb 2021 13:11:00 -0600
Message-ID: <ef4a9916-5097-1dd6-8cf8-a0fd29352d0c@gmail.com> (raw)
In-Reply-To: <2DD24450-CD97-4212-89A9-3640A07B1E0C@yahoo.com>
References: <8D049DD1-DC0D-498B-B7C1-773C4FB82B22.ref@yahoo.com>
	<8D049DD1-DC0D-498B-B7C1-773C4FB82B22@yahoo.com>
	<39D5CE9D-B64F-420F-8260-88B6CD50DED3@datylon.com>
	<2DD24450-CD97-4212-89A9-3640A07B1E0C@yahoo.com>

What would you tell pgadmin?  "Order *this* *particular* query -- out of all 
the billion queries I might write -- in *this particular* manner?"

No, that's not how things work.  Just add an ORDER BY when you query the table.

On 2/16/21 12:48 PM, Dan Nessett wrote:
> Thanks Peter. The listing of the result is from pg-admin 4.30 using view/edit data applied to the household_data table. In the past this has always returned the table contents in the ORDR BY sort order. Do I need to specify some preference in pg_admin to guarantee this?
>
> Dan
>
>> On Feb 16, 2021, at 11:34 AM, Peter Coppens <peter.coppens@datylon.com> wrote:
>>
>> Not sure how you select the household
>>
>>> The result is (only the first column is shown):
>>>
>>> household_name
>>>
>>> "Garcia"
>>> "Armstrong"
>>> "Armstrong"
>>> "Bauer"
>>> "Bauer"
>>> "Berst"
>>> "Berst"
>>> "Minch (xxxx)"
>>> "Berst"
>>> “Besel”
>>
>> but unless you select from the resulting table using again an order by, the rows will be returned in an undetermined order. Such is the nature of the relational model - there is no order you can rely on when selecting, unless you specify it
>>
>> Hth,
>>
>> Peter
>>
>
>

-- 
Angular momentum makes the world go 'round.

view thread (10+ messages)  latest in thread

Message-ID: <ef4a9916-5097-1dd6-8cf8-a0fd29352d0c@gmail.com>
Permalink:  ../ef4a9916-5097-1dd6-8cf8-a0fd29352d0c@gmail.com/
Also on:    postgresql.org/message-id/ef4a9916-5097-1dd6-8cf8-a0fd29352d0c@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Order by not working
  In-Reply-To: <ef4a9916-5097-1dd6-8cf8-a0fd29352d0c@gmail.com>
  References: <8D049DD1-DC0D-498B-B7C1-773C4FB82B22.ref@yahoo.com> <8D049DD1-DC0D-498B-B7C1-773C4FB82B22@yahoo.com> <39D5CE9D-B64F-420F-8260-88B6CD50DED3@datylon.com> <2DD24450-CD97-4212-89A9-3640A07B1E0C@yahoo.com> <ef4a9916-5097-1dd6-8cf8-a0fd29352d0c@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox