Re: SELECT MAX question

From: "Eric G(dot) Miller" <egm2(at)jps(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT MAX question
Date: 2001-04-01 05:56:50
Message-ID: 20010331215650.B678@calico.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Mar 31, 2001 at 09:11:39PM -0500, Jacob wrote:
> I have an sql tatement in my ASP page that has a WHERE date = (SELECT
> MAX(other_date) FROM SomeTable WHERE Blah1 = Blah2) clause. What's
> happening is that the query is grabbing the latest date ONLY if
> something something is in the "other_date" field. If the "other_date"
> field is blank, then the record is not chosen. My question is, how do
> I grab the latest date of "other_date" even if the it happens to be
> blank?

Think about what you're asking. How can anything or anybody know
whether or not a NULL date is greater than some other date? Maybe you
want to look into having a timestamp with a default of
CURRENT_TIMESTAMP?

--
Eric G. Miller <egm2(at)jps(dot)net>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Ivar Helbekkmo 2001-04-01 08:16:56 Re: Call for platforms
Previous Message Eric G. Miller 2001-04-01 05:48:42 Re: SQL Script