Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Very long "WHERE" list.
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
![]() |
![]() |