Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lC5kd-0003ie-JL for pgsql-general@arkaria.postgresql.org; Tue, 16 Feb 2021 19:11:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lC5kb-0004sW-Ke for pgsql-general@arkaria.postgresql.org; Tue, 16 Feb 2021 19:11:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lC5kb-0004sO-5s for pgsql-general@lists.postgresql.org; Tue, 16 Feb 2021 19:11:09 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lC5kU-0003D6-Gg for pgsql-general@lists.postgresql.org; Tue, 16 Feb 2021 19:11:06 +0000 Received: by mail-oi1-x235.google.com with SMTP id k204so12360162oih.3 for ; Tue, 16 Feb 2021 11:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=KrMdIDurOnNjkwuRpU/5CgxTvj1GbzokUca6KUAh79E=; b=oHlWRDLGrZBU6ubKGfwCJsF+OXWAyxWbzrisuXfhihCJ7DbfuSeec/2WRIsmKj4+LA /iFVjFoHL9v5Pz8/xFlvfNcGWyOUpNquB8n6/mMLxdT3iMTYeifwXlpeotokoqfPJ68B 98WN0bjpFcAPav/CepEHKXQ+52Ax4o9wTG2G4Cot7LaF28p5W4nzFdf5GriycOVRGtY2 TpjU4ap7f3uLzWqDLiIycanQoOu/9o6lU2/ZYvbbMcAZdGs3TRFb1AisZonnnWcc5jFP H0NzmMOhk77V2PXgkA5x2RDH9WJ67WIFZ6PassG31FM4Nb+62nyzeSpaVoEHvhO7Iy3C bKeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=KrMdIDurOnNjkwuRpU/5CgxTvj1GbzokUca6KUAh79E=; b=eZIkk4qA+OO/hPa4+/5D0cua3yMR6wl4EM2FL1CeJO+9UMCvLOq5aZrZesC6CceHec +7ltCuKoSprDr75tfj1rOxqkdWB7m+qGVLanhHPaKEJieUIV3+dkKGpQE0gkpNaRbS3W mw++6q5nvx3378HNOzvah/vTptUq/Hwg9VXtqEu3lDUgE2J79YWQ4E3Y4Se5qepbfN8O 1Dabt7z+tqkn9PGsRHyYnT/5BdAM4atoSlvg5bPCT8j5Kf/TL9+4A5Wzv3dUuM0iQBXG PFvBAq3rQt1L+s4MLvhMYAD9Sp/h4SA1jNrPnr5UEsVejX6RRsHTWRGeLj5qkMLwU1mD Bk1Q== X-Gm-Message-State: AOAM531Sx9i2Q5gMsYR+1+KHhwszn1RdAKLnq7aW6K8yo1C0a1e8FLuU yx3DRbOVgFklExz2BtdriiIVqyjm6u571g== X-Google-Smtp-Source: ABdhPJyLrwPNgYnCRrL7CRc8+bS1VVNm2/XGXbkwphovZC5AlDWDmj1NKAcVY61sPTJHaxLYeHygtw== X-Received: by 2002:aca:568f:: with SMTP id k137mr3638684oib.164.1613502661763; Tue, 16 Feb 2021 11:11:01 -0800 (PST) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id t4sm2665078ooh.4.2021.02.16.11.11.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Feb 2021 11:11:01 -0800 (PST) Subject: Re: Order by not working To: pgsql-general@lists.postgresql.org 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> From: Ron Message-ID: Date: Tue, 16 Feb 2021 13:11:00 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <2DD24450-CD97-4212-89A9-3640A07B1E0C@yahoo.com> Content-Type: multipart/alternative; boundary="------------049741AB7D28F78FC59D2330" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------049741AB7D28F78FC59D2330 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 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. --------------049741AB7D28F78FC59D2330 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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.
--------------049741AB7D28F78FC59D2330--