Re: max length of sql select statement ?

From: markus brosch <brosch(at)gmx(dot)de>
To: mallah(at)trade-india(dot)com
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: max length of sql select statement ?
Date: 2003-07-07 16:20:20
Message-ID: 1057594820.881.115.camel@sam
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 2003-07-07 at 18:13, mallah(at)trade-india(dot)com wrote:
> Well i DO NOT know the exact limit.
> May be someone else can answer it accurately.
>
> But you could produce the list within IN using a subselect
> that again depends on the exact problem.
>

Maybe anybody knows how many?

Anyway: My exact problem is "in words" quite easy:

col1 | col2
------------
123 | 958
143 | 394
124 | 345
324 | 345
346 | 541
743 | 144
346 | 986

Imagine, this table is really big (millions records).
Now, I want to retrieve for all records in col A OR col B where either
123, 124, 144, 541 (and a view thousands more ...) fits.

As far as I understud you:
SELECT * FROM table
WHERE col1 IN (123,124,144,541,...)
OR col2 IN (123,124,144,541,...);

Cheers, Markus

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rod Taylor 2003-07-07 16:20:53 Re: max length of sql select statement ?
Previous Message mallah 2003-07-07 16:13:45 Re: max length of sql select statement ?