Received: from gatekeeper.informatik.fh-dortmund.de (root@gatekeeper.informatik.fh-dortmund.de [193.25.22.84]) by hub.org (8.9.2/8.9.1) with ESMTP id IAA36600 for ; Tue, 30 Mar 1999 08:37:53 -0500 (EST) (envelope-from RalfW@Scalar.DE) Received: from onyx.nowhere.net (avatar@port17.scalar.de [195.190.25.209]) by gatekeeper.informatik.fh-dortmund.de (8.8.8/8.8.8) with SMTP id PAA04711 for ; Tue, 30 Mar 1999 15:40:32 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14080.54206.589052.518312@onyx.nowhere.net> Date: Tue, 30 Mar 1999 15:38:06 +0200 (CEST) From: Ralf Weidemann To: PGSQL-GENERAL-ML Subject: sorting by date & time in descending order ?? X-Mailer: VM 6.70 under 21.0 "Dagon" XEmacs Lucid Reply-To: Ralf Weidemann 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 creationtime desc; surname |creationdate|creationtime --------------------+------------+------------ 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 | 29.03.1999|09:10:04 Name_2 | 30.03.1999|09:10:04 Name_3 | 22.03.1999|06:02:55 (6 rows) wdb=> select surname, creationdate, creationtime from message order by creationdate desc; surname |creationdate|creationtime --------------------+------------+------------ Name_2 | 30.03.1999|14:05:47 Name_2 | 30.03.1999|10:10:04 Name_1 | 30.03.1999|14:46:17 Name_2 | 30.03.1999|09:10:04 Name_2 | 29.03.1999|09:10:04 Name_3 | 22.03.1999|06:02:55 (6 rows) 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) CREATE TABLE Message ( MessageID SMALLINT NOT NULL, Title CHAR(20) NOT NULL, Surname CHAR(50) NOT NULL, EMail CHAR(100), MessageURL CHAR(100), Text VARCHAR NOT NULL, CreationDate DATE NOT NULL, CreationTime TIME NOT NULL, Expiry SMALLINT NOT NULL );