Felix Radensky <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there any limitation on the number of elements in IN clause ?
> Can one have, e.g. thousands of elements ? Also, can having 
> to many elements become inefficient at some point and one
> has to use some other technique, i.e. comparing elements one
> by one in a loop ?
> 

You can create a table that contains the elements that you would
normally put in your IN clause:

   CREATE TEMP TABLE stuff(x);
   INSERT INTO stuff VALUES('one');
   INSERT INTO stuff VALUES('two');
   ....
   INSERT INTO stuff VALUES('one million');

Then run your query this way:

   SELECT * FROM maintable WHERE key IN stuff;

--
D. Richard Hipp <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to