Arbitrary amount of BETWEENs

From: dee <buhhko_at_gmail.com>
Date: Mon, 28 Apr 2008 16:01:55 -0700 (PDT)
Message-ID: <3e5be5e5-b789-49f3-ac4d-21e250955dae@y21g2000hsf.googlegroups.com>


Hi...

I have an index organized table on which i'll be carrying out a select of the following type...

select value from table
where key between 1 and 4 or key between 9 and 11 ....... or key between 100 and 201

The current issue is, that the amount of range selects is arbitrary and in worst case this query could end up awfully long. All that comes to my mind right now is gluing a string up dynamically in pl/sql and executing it... However.. Makes my stomach turn over big time as I'm guessing this involves serious parsing and processing overhead eliminating the win-win on doing range selects on an index organized table...

I'd appreciate if anyone could point me in the direction of a cleaner approach which i might have overlooked :)

Regards :) Received on Mon Apr 28 2008 - 18:01:55 CDT

Original text of this message