Re: Sorting distinct dates by year and month respectively

Поиск
Список
Период
Сортировка
От Matt Arnilo S. Baluyos (Mailing Lists)
Тема Re: Sorting distinct dates by year and month respectively
Дата
Msg-id d1a6d7930606071136y53b5ddd2kbdbb659ca2e51bf5@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sorting distinct dates by year and month respectively  (Richard Broersma Jr <rabroersma@yahoo.com>)
Список pgsql-novice
On 6/7/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> You want
>         ... ORDER BY date_part('year', article_pubdate) DESC,
>         date_part('month', article_pubdate) DESC;
> As noted by the other respondent, sorting on one date_trunc column is
> probably the better way to do it, but I thought I'd point out the DESC
> issue anyway.  A lot of people get that wrong.

On 6/7/06, Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> you should specify asc or desc for both columns to insure the desired result.

Thanks Tom and Richard. It works as intended now. Learned something new today.

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Sorting distinct dates by year and month respectively
Следующее
От: "Florian Reiser"
Дата:
Сообщение: Re: Why do I need an Account to install the PostGreSQL?