dbTalk Databases Forums  

Problem with IN and LIST()

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Problem with IN and LIST() in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tomaz
 
Posts: n/a

Default Problem with IN and LIST() - 08-24-2009 , 04:57 AM






Hello!

I have strange problem. In SQL statement:
SELECT p.datumdokumenta,p.sifrastranke,naziv1,(if p.veznazapstevprometa='0'
then p.veznidokument else (select z.ppsklic from SAOP_DKPROMET z where
z.zaporednastevilkaprometa=p.veznazapstevprometa) endif) as dokument,
(if p.veznazapstevprometa='0' then null else (select z.datumvalute from
SAOP_DKPROMET z where z.zaporednastevilkaprometa=p.veznazapstevprometa)
endif) as datum_zapadlosti,
isnull(datediff( day, DATUM_ZAPADLOSTI, DATUM_PLACILA ),0) as
razlika,S.FIZ_PRAV_OSEBA,


cast(p.datumdokumenta as date) as
datum_PLACILA,p.znesekdobro,p.znesekzaprtodobro FROM "DBA"."SAOP_DKPROMET" p
LEFT outer join sif_stranke s on p.sifrastranke=s.SIFRA_SAOP
where p.letnicaposlovnegaleta=f_get_poslovno_leto_saop(1 ) and p.sifrakonta
in (120000,120400,1211000,1212000,1213900) and p.sifratemeljnice=410

you see on the end in (120000,120400,1211000,1212000,1213900). With this I
get result, but where I change here to

in (select list(konto) from sif_saop_konti_parametri where podjetje_id = 1
and vrsta_uporabe = 1 and status = 1)

I don't get any result. But when I run this subselect: select list(konto)
from sif_saop_konti_parametri where podjetje_id = 1 and vrsta_uporabe = 1
and status = 1 I get the same result like in first statement.

What coul be problem?

Regards

Tomaz

Reply With Quote
  #2  
Old   
Chris Werner
 
Posts: n/a

Default Re: Problem with IN and LIST() - 08-24-2009 , 05:54 AM






Hi Tomaz,

drop the LIST keyword from your embedded query:

select konto from sif_saop_konti_parametri ...

HTH

Chris Werner
f+s software gmbh

"Tomaz" <kralj.soft4you (AT) gmail (DOT) com> schrieb im Newsbeitrag
news:4a926415$1 (AT) forums-1-dub (DOT) ..
Quote:
Hello!

I have strange problem. In SQL statement:
SELECT p.datumdokumenta,p.sifrastranke,naziv1,(if
p.veznazapstevprometa='0' then p.veznidokument else (select z.ppsklic from
SAOP_DKPROMET z where z.zaporednastevilkaprometa=p.veznazapstevprometa)
endif) as dokument,
(if p.veznazapstevprometa='0' then null else (select z.datumvalute from
SAOP_DKPROMET z where z.zaporednastevilkaprometa=p.veznazapstevprometa)
endif) as datum_zapadlosti,
isnull(datediff( day, DATUM_ZAPADLOSTI, DATUM_PLACILA ),0) as
razlika,S.FIZ_PRAV_OSEBA,


cast(p.datumdokumenta as date) as
datum_PLACILA,p.znesekdobro,p.znesekzaprtodobro FROM "DBA"."SAOP_DKPROMET"
p
LEFT outer join sif_stranke s on p.sifrastranke=s.SIFRA_SAOP
where p.letnicaposlovnegaleta=f_get_poslovno_leto_saop(1 ) and p.sifrakonta
in (120000,120400,1211000,1212000,1213900) and p.sifratemeljnice=410

you see on the end in (120000,120400,1211000,1212000,1213900). With this I
get result, but where I change here to

in (select list(konto) from sif_saop_konti_parametri where podjetje_id = 1
and vrsta_uporabe = 1 and status = 1)

I don't get any result. But when I run this subselect: select list(konto)
from sif_saop_konti_parametri where podjetje_id = 1 and vrsta_uporabe = 1
and status = 1 I get the same result like in first statement.

What coul be problem?

Regards

Tomaz


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.