Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why doesn't work

0 views
Skip to first unread message

Tomaz

unread,
Oct 7, 2008, 5:29:16 AM10/7/08
to
Hi!

I have following sql statement:

select * from sif_artikli_pretvorbe where
iz_pakiranje_id in (if 3<=5 then (1 , 2, 3, 4, 5) else 5 endif);

It gives me error "Syntax error near , on line 2".

Why? How to make it work?

ASA 9.02

regards

Tomaz


Usmanov A.

unread,
Oct 7, 2008, 6:49:00 AM10/7/08
to
For example:
begin
declare @parm integer;
set @parm=3;

select  *  from sif_artikli_pretvorbe where
    (sif_artikli_pretvorbe in (1, 2, 3, 4, 5) and @parm<=5) or (@parm>5 and sif_artikli_pretvorbe=5);
end;
--
Best regards,
 
Alex Usmanov
ASA\ML\UL 9.0.2.3361
"Tomaz" <kralj.s...@gmail.com> сообщил/сообщила в новостях следующее: news:48eb2bec$1@forums-1-dub...
0 new messages