Re: Ordering YYYY MM DD in reverse chrono order

Поиск
Список
Период
Сортировка
Искать
От
Eric Ridge
Тема
Re: Ordering YYYY MM DD in reverse chrono order
Дата
Msg-id
FCC3FDB7-97C8-11D8-A691-000A95BB5944@tcdi.com
Ответ на
Ordering YYYY MM DD in reverse chrono order (otis_usenet@yahoo.com (OtisUsenet))
Список
Дерево обсуждения
Ordering YYYY MM DD in reverse chrono order otis_usenet@yahoo.com (OtisUsenet)
Re: Ordering YYYY MM DD in reverse chrono order "John Sidney-Woollett" <johnsw@wardbrook.com>
Re: Ordering YYYY MM DD in reverse chrono order Clodoaldo Pinto Neto <clodoaldo_pinto@yahoo.com.br>
Re: Ordering YYYY MM DD in reverse chrono order Holger Klawitter <lists@klawitter.de>
Re: Ordering YYYY MM DD in reverse chrono order Scott Ribe <scott_ribe@killerbytes.com>
Re: Ordering YYYY MM DD in reverse chrono order Eric Ridge <ebr@tcdi.com>
On Apr 21, 2004, at 5:19 AM, OtisUsenet wrote:


> I am using the following query, but it's not returning dates back in
> the reverse chronological order:



> ORDER BY
> date_part('year', uu.add_date), date_part('month', uu.add_date),
> date_part('day',  uu.add_date) DESC;

Maybe I'm missing something, but why not just sort by "uu.add_date 
DESC", like so:

	ORDER  BY uu.add_date DESC;

Seems like it would be more efficient, and there'd be no issues about 
forgetting to put DESC after each date_part() (like you have above).

eric

В списке pgsql-general по дате отправления
От: Bruce Momjian
Дата:
От: Dave Cramer
Дата:
FAQ