From: Mitch Vincent <mitch@venux.net>
To: pgsql-sql@postgresql.org
Subject: Orderby two different columns
Date: Fri, 23 Jun 2000 10:29:59 -0400
Message-ID: <005d01bfdd1f$8359fa60$0300000a@doot.org> (raw)
References: <m135JRS-000AY3C@druid.net>
I ran into a problem today that I hope someone can help me with...
I have a database (and application) that is used to track 'applicants'..
These applicants have two timestamp fields associated with their records and
both have relevance as to how long the applicant has been available..
The resubmitted field s of type timestamp and has a default value of 'Sat
Oct 02 00:00:00 1999 EDT'
I need to order search results by the two dates. Here is the problem..
They want whichever date is the most recent to appear on top.. If I do
'order by resubmitted desc,created desc' I get something like this :
Applicant Re-submitted Created
A 06/05/2000 12/31/1999
B 06/05/2000 12/31/1999
C 05/17/2000 02/09/2000
D 05/17/2000 01/21/2000
E 05/11/2000 01/27/2000
F 05/11/2000 01/21/2000
G 05/01/2000 12/31/1999
H 04/28/2000 01/28/2000
I 04/28/2000 01/12/2000
J 05/23//2000
Ok, see applicant J? I need him to be above C.. Basically what I need to do
is order by a combination of date created/resubmitted -- the way I'm doing
it now is going to list al the resubmitted's in order, then all the
created's in order.. Perhaps I'm just missing something simple, I sure hope
so..
Hopefully I've explained it well enough. Thanks for any suggestions!!!
-Mitch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: mitch@venux.net
Subject: Re: Orderby two different columns
In-Reply-To: <005d01bfdd1f$8359fa60$0300000a@doot.org>
References: <m135JRS-000AY3C@druid.net> <005d01bfdd1f$8359fa60$0300000a@doot.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox