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 9DAFAEFEA7 for ; Wed, 4 Jun 2003 14:59:13 +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 80815-07 for ; Wed, 4 Jun 2003 14:59:12 +0000 (GMT) Received: from zenon.apartia.com (ATuileries-107-2-1-69.w217-128.abo.wanadoo.fr [217.128.120.69]) by svr1.postgresql.org (Postfix) with ESMTP id 00898EFE9B for ; Wed, 4 Jun 2003 14:59:00 +0000 (GMT) Received: from argos (argos.apartia.fr [10.0.2.105]) by zenon.apartia.com (Postfix) with ESMTP id CB3B11D7AB for ; Wed, 4 Jun 2003 16:59:04 +0200 (CEST) Received: by argos (Postfix, from userid 1018) id 327ED1DEA; Wed, 4 Jun 2003 16:59:02 +0200 (CEST) Date: Wed, 4 Jun 2003 16:59:02 +0200 From: David Pradier To: pgsql-sql@postgresql.org Subject: How to make a IN without a table... ? Message-ID: <20030604145901.GB766@apartia.fr> Mail-Followup-To: pgsql-sql@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.3i X-Archive-Number: 200306/46 X-Sequence-Number: 13804 Hi everybody, i ran today in a problem when doing some (too much for me) advanced sql... What i want to do is something like this: SELECT my_var1, my_var2, my_function(my_var1, my_var2) FROM ( SELECT '1', '2', '3', '4' ) AS my_var1_values, ( SELECT '1', '2', '3', '4' ) AS my_var2_values In short, i want to calculate the result of the function my_function for some values of my_var1, cross by some values of my_var2. These values are not taken in a table, but put in directly. They are a lot, so i would prefer not to write the whole thing, line after line. (Let's say 10 values for the first, and 40 for the second => 400 lines of code to maintain...) I really don't see how to do this :-/ Any help is heartfully welcome, David -- dpradier@apartia.fr 01.46.47.21.33