X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id B1A20B43848 for ; Mon, 7 Jul 2003 16:23:09 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 53310-03 for ; Mon, 7 Jul 2003 13:22:58 -0300 (ADT) Received: from mail.bgm-gmbh.de (gamma.bgm-hosting.de [217.115.144.90]) by svr1.postgresql.org (Postfix) with ESMTP id 95538B43368 for ; Mon, 7 Jul 2003 13:22:58 -0300 (ADT) Received: from bgm-gmbh.de (localhost [127.0.0.1]) by mail.bgm-gmbh.de (Postfix) with ESMTP id 46F0CB64A0; Mon, 7 Jul 2003 18:22:58 +0200 (CEST) Received: from [141.40.169.188] (unknown [141.40.169.188]) by mail.bgm-gmbh.de (Postfix) with ESMTP id E5597B6184; Mon, 7 Jul 2003 18:22:56 +0200 (CEST) Subject: Re: max length of sql select statement ? From: markus brosch To: mallah@trade-india.com Cc: pgsql-sql In-Reply-To: <1134.219.65.226.199.1057594425.squirrel@mail.trade-india.com> References: <1057592658.881.93.camel@sam> <1101.219.65.226.199.1057593454.squirrel@mail.trade-india.com> <1057594050.886.104.camel@sam> <1134.219.65.226.199.1057594425.squirrel@mail.trade-india.com> Content-Type: text/plain Organization: Message-Id: <1057594820.881.115.camel@sam> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 07 Jul 2003 18:20:20 +0200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/75 X-Sequence-Number: 14189 On Mon, 2003-07-07 at 18:13, mallah@trade-india.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