Re: forcing date ordering

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: forcing date ordering
Дата
Msg-id 7649.1094883767@sss.pgh.pa.us
обсуждение исходный текст
Ответ на forcing date ordering  ("tab view" <tabview@hotmail.com>)
Список pgsql-novice
"tab view" <tabview@hotmail.com> writes:
> When I do the following piece of SQL
> SELECT DISTINCT to_char(datetimelogged,'dd/mm/yyyy') AS datelogged FROM
> logins ORDER BY datelogged DESC;

> I don't seem to get the column sorted in date order.

I'd expect that to produce a textual sorting of the to_char strings.

> How do I force psql to use date order?

Sort by the underlying datetimelogged column, which I suppose is of
date or timestamp type ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Alter session set current_schema
Следующее
От: Ennio-Sr
Дата:
Сообщение: Re: iso-8859-2