Re: Order by not working

From: Dan Nessett <dnessett(at)yahoo(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Order by not working
Date: 2021-02-16 19:21:33
Message-ID: 1D84F613-D7C7-4EC0-95EF-4FBB56D0F160@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks,

Dan

> On Feb 16, 2021, at 12:11 PM, Ron <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> 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(dot)coppens(at)datylon(dot)com> <mailto:peter(dot)coppens(at)datylon(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-02-16 19:35:00 Re: Order by not working
Previous Message Ron 2021-02-16 19:11:00 Re: Order by not working