🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: CASE with test on null field

#642
From: Martijn Tonies
Date: Tue, 18 Sep 2007 18:41
35 lines
1483 bytes
> I always get null result with :
>
> case c.descr
> when '' then a.desmov
> else a.desmov ||'
> '||  c.Descr end as Descreg
>
>
> when c.descr is null and a.desmov is not null ?

NULL <> ''

Doesn't
when NULL then a.desmov

work?

> I tried :
> case (Cast(c.descr as varchar(60)))
> when '' then a.desmov
> else a.desmov ||'
> '||  c.Descr end as Descreg
>
> but same result.


-- 
Martijn Tonies
Database Workbench - the IBConsole alternative!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Technical Details
Message-ID: <46f01bc0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46f01a4a@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: "Martijn Tonies" <m.tonies@upscene.removethis.com>
Newsgroups: borland.public.interbase.sql
References: <46f01a4a@newsgroups.borland.com>
Subject: Re: CASE with test on null field
Date: Tue, 18 Sep 2007 20:41:00 +0200
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: 212.238.159.172
Message-ID: <46f01bc0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1190140864 212.238.159.172 (18 Sep 2007 11:41:04 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail