Re: IFNULL -> COALESCE

From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IFNULL -> COALESCE
Date: 2002-02-08 17:17:03
Message-ID: 15460.2063.311288.503373@kelvin.csl.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne writes:
> lkindness(at)csl(dot)co(dot)uk writes:
> > SELECT COALESCE(MAX(id), 0) + 1 from test;
> > can be replaced by the following PostgreSQL query:
> > SELECT COALESCE(MAX(id), 0) + 1 from test;
> Ummm...did you make a mistake here? Those statements are
> identical...

Okay, lets try that again...

SELECT IFNULL(MAX(id), 0) + 1 from test;

can be replaced by the following PostgreSQL query:

SELECT COALESCE(MAX(id), 0) + 1 from test;

Thanks, Lee.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2002-02-08 17:23:40 Re: GiST on 64-bit box
Previous Message Karel Zak 2002-02-08 17:15:28 Re: Threaded PosgreSQL server