"tab view" <tabview (AT) hotmail (DOT) com> writes:
Quote:
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.
Quote:
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
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match