🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.databases
Article #211

Re: converting NULL to ANY value in a SELECT (local SQL)

#211
From: paloh
Date: Thu, 15 Jul 1999 00:00
17 lines
1682 bytes
In article <378D66CA.AFA6936B@kc4.so-net.ne.jp>,
  Mike Ryan <mryan@kc4.so-net.ne.jp> wrote:
> I have a select in which I NEED to convert a NULL to ANY numeric value
> e.g. 0, -1 ... whatever, I dont care, I just need a numeric value.
>
> in the table temp, there is 2 fields a&b , the table contains records
> where b is sometimes NULL, the data type of both fields are INT. There
> is no way I can change the code so that NULL defaults to 0, it has to
be
> NULL.
>

SELECT a,cast(cast(a as char(4))+'0' as integer)/10 from pok.db


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID: <7mkfkg$d0j$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <378D66CA.AFA6936B@kc4.so-net.ne.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ffff5,f9ad5d8bc8693d8a
X-Google-Attributes: gidffff5,public
X-Google-Thread: f973d,f9ad5d8bc8693d8a
X-Google-Attributes: gidf973d,public
X-Google-Thread: fd817,f9ad5d8bc8693d8a
X-Google-Attributes: gidfd817,public
X-Google-Thread: f68c4,f9ad5d8bc8693d8a
X-Google-Attributes: gidf68c4,public
From: paloh@my-deja.com
Subject: Re: converting NULL to ANY value in a SELECT (local SQL)
Date: 1999/07/15
Message-ID: <7mkfkg$d0j$1@nnrp1.deja.com>
X-Deja-AN: 501277903
References: <378D66CA.AFA6936B@kc4.so-net.ne.jp>
X-Http-Proxy: 1.0 debian.pvt.sk:3128 (Squid/2.2.STABLE3), 1.0 x36.deja.com:80 (Squid/1.1.22) for client 10.59.1.99, 195.28.65.116
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Thu Jul 15 11:11:17 1999 GMT
X-MyDeja-Info: XMYDJUIDpaloh
Newsgroups: comp.lang.pascal.delphi.databases,corelsupport.paradox8,alt.comp.lang.borland-delphi,alt.lang.delphi
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.0; Windows NT)