Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Trying to use "where in" to select from a list

Re: Trying to use "where in" to select from a list

From: <buckeye714_at_my-deja.com>
Date: Wed, 19 Jan 2000 14:38:04 GMT
Message-ID: <864i8a$5fk$1@nnrp1.deja.com>


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

Original text of this message

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