Re: forcing date ordering - Mailing list pgsql-novice

From Tom Lane
Subject Re: forcing date ordering
Date
Msg-id 7649.1094883767@sss.pgh.pa.us
Whole thread Raw
In response to forcing date ordering  ("tab view" <tabview@hotmail.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Alter session set current_schema
Next
From: Ennio-Sr
Date:
Subject: Re: iso-8859-2