From: Randolph Jones <jonesrf1@qwest.net>
To: pgsql-sql@postgresql.org
Subject: sort up then down
Date: Sat, 12 Apr 2003 18:50:07 -0700
Message-ID: <3E98C24F.1070507@qwest.net> (raw)
I have database fields 1234567891.001;
I want to sort on first 10 digits descending; (last date first)
then ascending on the last 3 digit (page numbers)
the statement below gives the right answer,
but is this how to do it?
SELECT substr(imgname,1,10) AS name, substring(imgname,12,3) AS pg FROM
fax GROUP BY imgname, pg ORDER BY name DESC, pg ASC;
TIA
rfjones
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jonesrf1@qwest.net
Subject: Re: sort up then down
In-Reply-To: <3E98C24F.1070507@qwest.net>
* 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