Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trying to use "where in" to select from a list
In article <388586D4.9F704E2B_at_gaul-edin.freeserve.co.uk>,
"Ken Gaul (06)" <ken_at_gaul-edin.freeserve.co.uk> wrote:
> If I understand correctly what you want is
>
> select data from mytable where instr(contents,'2')>0
>
> Ken.
>
One caveat to Kens example. If the list contains 12 or 22,etc. then instr(contents,'2') will return greater then 0. If you are searching for a specific integer, wrap it with the delimiter in the select statement. For example, select data from mytable where instr(contents,',2,')>0 will be true only if ,2, exists in the list. You will need special care to handle the first and last integer of the list.
HTH
Patrick
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Jan 19 2000 - 08:38:04 CST