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))
Список pgsql-general
On Apr 21, 2004, at 5:19 AM, OtisUsenet wrote:
<snip>

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

<snip>

> 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
Дата:
Сообщение: Re: shadowing (like IB/Firebird)
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: [JDBC] loading data into postgresql became slow