Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: empty string or null

Re: empty string or null

From: Andreas Mosmann <mosmann_at_expires-31-03-2007.news-group.org>
Date: Fri, 30 Mar 2007 09:25:28 +0200
Message-ID: <1175239528.67@user.newsoffice.de>


Frank van Bortel schrieb am 29.03.2007 in <euh3bm$rhd$1_at_news4.zwoll1.ov.home.nl>:

> Andreas Mosmann schreef:
> [snip]

>> try a JOIN ...
>> SELECT * FROM ADDRESSES A
>> LEFT JOIN JOBS J ON
>> (A.FIRSTNAME=B.FIRSTNAME) and (A.MIDDLENAME=B.MIDDLENAME) and
>> (A.FAMILYNAME=B.FAMILIYNAME);
>>
>> no MIDDLENAME- no job
>>
>> Andreas Mosmann
>>
>>

> Does this mean I have a job, and you don't? > :)

I know about VARCHAR2, so I would write the correct query ;)

SELECT * FROM ADDRESSES A
LEFT JOIN JOBS J ON
 (A.FIRSTNAME=B.FIRSTNAME
   or A.FIRSTNAME is NULL and B.FIRSTNAME is NULL)  and
 (A.MIDDLENAME=B.MIDDLENAME
   or A.MIDDLENAME is NULL and B.MIDDLENAME is NULL)  and
 (A.FIRSTNAME=B.FAMILIYNAME
   or A.FAMILIYNAME is NULL and B.FAMILIYNAME is NULL)  and NULL is NULL
 and 1=1
 and 2=2
 ..
 and 'A'='A'
 ..

are you interested in knowing which job has Mr. ? (long time ago he had to call himself "nobody", but now "" is a correct name)

best regards
Andreas <no middlename> Mosmann

-- 
wenn email, dann AndreasMosmann <bei> web <punkt> de
Received on Fri Mar 30 2007 - 02:25:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US