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: Very long "WHERE" list.

Re: Very long "WHERE" list.

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: 8 Jul 2004 23:52:12 -0700
Message-ID: <73e20c6c.0407082252.14e6fd5c@posting.google.com>


gumenyuk_at_canada.com (Serguei) wrote in message news:<c1e8f29a.0407080842.557330e1_at_posting.google.com>...

> I have to execute a SELECT statement with a very long "IN" list with
> several thousands of values:
>
> SELECT something FROM table WHERE id IN (1,3,5, ...., 20001)

Gawd, another one...

> Unfortunately Oracle can not process this request directly.

Correction: NO DATABASE whatsoever can process that query, not just Oracle.

> Is there
> any way to by path this limitation?

Yes. If that is a code or ID in another table, then use EXISTS (subquery) instead of this ridiculous IN list.

If it isn't, then fix the design and make it so.

Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam Received on Fri Jul 09 2004 - 01:52:12 CDT

Original text of this message

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