Re: [GENERAL] sorting by date & time in descending order ??

From: Kollar Lajos <KOLLARLAJOS(at)TIGRIS(dot)KLTE(dot)HU>
To: Ralf Weidemann <RalfW(at)Scalar(dot)DE>
Cc: PGSQL-GENERAL-ML <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] sorting by date & time in descending order ??
Date: 1999-03-30 14:49:08
Message-ID: Pine.VMS.3.91-A.990330154544.35741A-100000@tigris.klte.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Tue, 30 Mar 1999, Ralf Weidemann wrote:

> Hi all,
>
> I want to sort my output by date & time in descending
> order. How can I do this ? Date or time alone is not
> enough and the combination of both does not work. At
> least in the way I tried it..
>
> Thanks,
> Ralf
>
> ...
>
> wdb=> select surname, creationdate, creationtime
> from message order by creationdate, creationtime desc;
> surname |creationdate|creationtime
> --------------------+------------+------------
> Name_3 | 22.03.1999|06:02:55
> Name_2 | 29.03.1999|09:10:04
> Name_1 | 30.03.1999|14:46:17
> Name_2 | 30.03.1999|14:05:47
> Name_2 | 30.03.1999|10:10:04
> Name_2 | 30.03.1999|09:10:04
> (6 rows)
>
this orders creationdate asc and creationtime desc as the output also shows,
so try:

select surname, creationdate, creationtime
from message order by creationdate desc, creationtime desc;

this should work.

Lajos

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Herouth Maoz 1999-03-30 14:59:16 Re: [GENERAL] How to do this in SQL?
Previous Message Chris Bitmead 1999-03-30 14:45:28 How to do this in SQL?

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1999-03-30 14:59:16 Re: [GENERAL] How to do this in SQL?
Previous Message Chris Bitmead 1999-03-30 14:45:28 How to do this in SQL?