From: Bill <bchie@opensys.com.hk>
To: pgsql-sql@postgresql.org
Subject: Re: DateDiff, IsNull?
Date: Wed, 15 Aug 2001 11:44:27 +0800
Message-ID: <9lcrij$15lk$2@news.tht.net> (raw)
References: <9lb25o$psq$1@news.tht.net>
<Pine.WNT.4.33.0108140634400.1680-100000@CX1198465-B>
IsNull work like this
SELECT IsNull( user_name, '') FROM user ;
then the query will return empty string when the field user_name is null
Regards
Bill
> > Hello all,
> >
> > I am a newbie to postgreSQL, is it possible to write a "DateDiff",
> > "IsNull" function work same as the one in SQL Server and are there and
> > sample out there? And is it possible to override the existing function
and
> > operator like "+" to become a concate?
>
> I don't know what IsNull does but:
>
> template1=> select coalesce(NULL, 'Hello');
> case
> -------
> Hello
> (1 row)
>
> I do know what DateDiff does:
>
> template1=> select '2001-08-14'::date - '6 weeks'::interval;
> ?column?
> ------------------------
> 2001-07-03 00:00:00-05
> (1 row)
>
> Overloading operators? *Please* tell me that this is impossible.
>
> Alan Gutierrez
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bchie@opensys.com.hk
Subject: Re: DateDiff, IsNull?
In-Reply-To: <9lcrij$15lk$2@news.tht.net>
* 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