CASE WHEN

From: Luiz Eduardo Cantanhede Neri <lecneri(at)gmail(dot)com>
To: postgresql novice <pgsql-novice(at)postgresql(dot)org>
Subject: CASE WHEN
Date: 2009-06-09 14:53:58
Message-ID: 252e1f290906090753u79e37ef9kfe78091129f3d7f1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi guys,

Just a simple question.

It's known that in SQL field = NULL is diferrent from from field IS NULL.
Does the same rule applies when you use CASE .. WHEN statement ?

e.g.
CASE myField
WHEN IS NULL THEN....

From my tests, shows this sintaxt is incorrect so I replaced to
CASE myField
WHEN NULL THEN ...

this 2nd example worked so far, but I'm worried about that isn't correct way
of doing it and may generate some failure returning rows with inconsistent
data.
So, you guys know if using this way is a valid CASE/WHEN sentence?

I know also there's
CASE
WHEN myField IS NULL THEN ...

but I'm asking about the 2nd way to make it clear to me.

Thx

Browse pgsql-novice by date

  From Date Subject
Next Message brucejhyatt 2009-06-11 00:34:28 Re: Yum Update Errors
Previous Message Merlin Moncure 2009-06-09 14:34:27 Re: Why lots of temp schemas are being created