Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Very long "WHERE" list.
Andy Hassall wrote:
> select count(*)
> from t
> where id in (1,3,5,7,9,11,13,15,17,19,21,23,25,27, [ snip, goes up to 20001 ]
> Andy Hassall <andy_at_andyh.co.uk> / Space: disk usage analysis tool
> http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
I just got past the ridiculous nature of an IN list with 20,000 members and thought I'd throw this one out for those interested.
SELECT COUNT(*)
FROM t
WHERE MOD(id, 2) = 1;
Now what to do with the time saved by not having to type in that ridiculous list. I think I'll have a scotch and take the boat out.
Daniel Morgan Received on Sun Jul 11 2004 - 15:52:19 CDT
![]() |
![]() |