Re: Sort by foreign date column - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Sort by foreign date column
Date
Msg-id Pine.BSF.4.21.0108202231220.3144-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Sort by foreign date column  ("Andrey Y. Mosienko" <feo@ttn.ru>)
List pgsql-general
On Tue, 21 Aug 2001, Andrey Y. Mosienko wrote:

>
> I have table with date type column:
>
> chdate date;
>
> SELECT chdate from mytable;
>
>    chdate
>  1999-01-02
>
> But in Russia we have the next date format: DD-MM-YYYY.
>
> When I do coversion to char in SELECT:
> TO_CHAR(chdate,'DD-MM-YYYY') everything is ok, but sort by this column
> executes as sort for char type.
>
> How can I display my native date format and do right sorting by this column?

Wouldn't
select to_char(chdate, 'DD-MM-YYYY') from mytable order by chdate;
work?


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Re: is this possible? it should be!
Next
From: Stephan Szabo
Date:
Subject: Re: not grokking outer joins...