RE: SELECT MAX question

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: "'ADBAAMD'" <adba(dot)amdocs(at)bell(dot)ca>, Jacob <Jay(at)cob(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: RE: SELECT MAX question
Date: 2001-04-01 16:43:37
Message-ID: 01C0BAA9.5FAD82E0.mascarm@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes. Its COALESCE(). Example:

SELECT COALESCE(NULL, 'Mike');
case
________
Mike
(1 row)

Hope that helps,

Mike Mascari
mascarm(at)mascari(dot)com

-----Original Message-----
From: ADBAAMD [SMTP:adba(dot)amdocs(at)bell(dot)ca]
Sent: Sunday, April 01, 2001 12:33 PM
To: Jacob
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] SELECT MAX question

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?

Adding my own question to this, does pgsql have an equivalent to the
Oracle NVL function?

Browse pgsql-general by date

  From Date Subject
Next Message Len Morgan 2001-04-01 16:51:15 Re: SELECT MAX question
Previous Message Daniel ?erud 2001-04-01 16:43:05 Re: RE: Re: Dissapearing indexes, what's that all about?