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

Home -> Community -> Usenet -> c.d.o.tools -> Re: select stmt with long list of comparisons ....howto

Re: select stmt with long list of comparisons ....howto

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 14 Apr 2001 13:53:05 +0200
Message-ID: <bfegdt056e0gbg7aedm9otk046cp70qnjg@4ax.com>

On Sat, 14 Apr 2001 05:04:57 GMT, kilidire <cr389_at_torfree.net> wrote:

>Hi,
>I have a very basic question that I would like resolvein in a more
>efficient way.
>
>select * from table1 where title = 'director' or title = 'officer' or
>title='chairman' .....
>
>
>
>Is there a more efficient way to do that if I have a long list of
>comaparisons to do in a select statement.
>Something like :
>select * from table1 where title IN
>('director','officer','chairman','accountant');
>
>
>Thanks all for the help.

Your second example is perfectly valid sql and it should work without problem. Maximum of 255 items in Oracle 7 and 1000 in Oracle 8.0 and beyond)

Hth,

Sybrand Bakker, Oracle DBA Received on Sat Apr 14 2001 - 06:53:05 CDT

Original text of this message

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