Re: Problems with "IN"

From: Jim Kennedy <kennedy-down_with_spammers_at_no_spam.comcast.net>
Date: Thu, 16 Oct 2003 01:45:26 GMT
Message-ID: <WKmjb.782313$Ho3.208508_at_sccrnsc03>


"Lisa S." <ljstewar_at_vac-acc.gc.ca> wrote in message news:ba0b4810.0310150916.67bf42e9_at_posting.google.com...
> Can someeone help! This works:
>
> SELECT * FROM sometable
> WHERE 1 IN (1, 2, 3) ;
>
> But if I want something like this:
>
> s_mylist VARCHAR2(20) := '1, 2, 3';
>
> SELECT * FROM sometable
> WHERE 1 IN ( s_mylist ) ;
>
> It doesn't work. Can't I do this?
>
> Thanks
> Lisa

It does not work because s_mylist is one thing the string '1, 2, 3' instead of
where 1 in (1,2,3)
Also you are comparing numbers and strings - not good. compare numbers and numbers.
Jim Received on Thu Oct 16 2003 - 03:45:26 CEST

Original text of this message