🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #557

Re: CASE with test on null field

#557
From: Bill Todd
Date: Thu, 20 Sep 2007 15:43
20 lines
1303 bytes
Adalberto Baldini wrote:

> Use of NULL  ,  IS NULL,  (IS NULL)  are not allowed in Case
> statement.

That is not correct. Try the following agains the sample Employee
database.

SELECT COUNTRY,
CASE
  WHEN (CURRENCY = 'Dollar') THEN 'XXX'
  WHEN (CURRENCY IS NULL) THEN 'NULL'
ELSE
  CURRENCY
END AS CURRENCY
FROM COUNTRY
ORDER BY COUNTRY

-- 
Bill Todd (TeamB)
Technical Details
Message-ID: <46f29532$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46f01a4a@newsgroups.borland.com> <46f02308$1@newsgroups.borland.com> <46f2225c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,fe8d0aeed0af284e
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd" <no@no.com>
Subject: Re: CASE with test on null field
Newsgroups: borland.public.interbase.sql
References: <46f01a4a@newsgroups.borland.com> <46f02308$1@newsgroups.borland.com> <46f2225c@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.6
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
NNTP-Posting-Host: 65.118.176.23
Message-ID: <46f29532$1@newsgroups.borland.com>
Date: 20 Sep 2007 08:43:46 -0700
X-Trace: newsgroups.borland.com 1190303026 65.118.176.23 (20 Sep 2007 08:43:46 -0700)
Lines: 20
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail