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: SQL select Problem

Re: SQL select Problem

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Tue, 10 Sep 2002 23:52:27 +1000
Message-ID: <9Fmf9.29012$g9.83113@newsfeeds.bigpond.com>

Hi Simon,

Are you sure you don't have a null value in one of your select lists that you are hoping to compare ? If KNR is null when KGR is null, it won't be picked up in the select list as a null never equals a null. Try NLVing the KGR and see it that helps.

Cheers

Richard

"Simon Heinrich" <sheinrich_at_hightech-vola.de> wrote in message news:alkj5k$88j$1_at_lancelot.camelot.de...
> Hi NG,
>
> I like to write an SQL select wich searches in an Collum for a list of
> Values and also inkludes that collums wich a 'NULL'
>
> SELECT
> "KUNDAT"."KNR", "KUNDAT"."KGR", "KUNDAT"."FNAME1", "KUNDAT"."FNAME2",
> "KUNDAT"."FNAME3","KUNDAT"."STR", "KUNDAT"."LAND", "KUNDAT"."PLZ",
> "KUNDAT"."ORT","KUNDAT"."POSNR", (SELECT sum ("KUNUMS"."UMS") from
> "DSPHTECH"."KUNUMS" "KUNUMS" where "KUNUMS"."JAHR" in (2001,2002) and
> "KUNDAT"."POSNR" = "KUNUMS"."PNKUNDAT" ) "Umsatz"
> FROM
> "HTECH"."KUNDAT" "KUNDAT",
> "HTECH"."KUNUMS" "KUNUMS"
> WHERE
> "KUNDAT"."POSNR" = "KUNUMS"."PNKUNDAT" And
> "KUNDAT"."NR" in ( select "KUNDAT"."KNR" from "HTECH"."KUNDAT"
 "KUNDAT"
> where "KUNDAT"."KGR" is in
>

 ('AM','CG','CG,GI','CG,PM','COMI','COMI-RF+F','DR','ES','GSH','GT','HÄ','HIL
>

 D','IGH','KL','ME','NW','NW-ME','RE','RK','SANIGRO','SED','SU','SU-AUS','SU,
>

 PI','TECHNO','THY','UH,PI','UH,BRICK','UH,H','UH,TAXIS','UH,VMG','VBH','VBH,
> B','WIEDEMANN','WUP') or "KUNDAT"."KGR" is null)
>
> ....but this doesen`t work :(
>
> I hope you can help me.
>
> Simon
>
>
>
Received on Tue Sep 10 2002 - 08:52:27 CDT

Original text of this message

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