sort up then down

Поиск
Список
Период
Сортировка
От Randolph Jones
Тема sort up then down
Дата
Msg-id 3E98C24F.1070507@qwest.net
обсуждение исходный текст
Ответы Re: sort up then down  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Itai Zukerman
Дата:
Сообщение: Re: count(*), EXISTS, indexes
Следующее
От: "Daniel Seichter"
Дата:
Сообщение: SELECT Blobs into a delphi program