pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Pradier <dpradier@apartia.fr>
To: pgsql-sql@postgresql.org
Subject: How to make a IN without a table... ?
Date: Wed, 4 Jun 2003 16:59:02 +0200
Message-ID: <20030604145901.GB766@apartia.fr> (raw)

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



view thread (14+ messages)  latest in thread

Message-ID: <20030604145901.GB766@apartia.fr>
Permalink:  ../20030604145901.GB766@apartia.fr/
Also on:    postgresql.org/message-id/20030604145901.GB766@apartia.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dpradier@apartia.fr
  Subject: Re: How to make a IN without a table... ?
  In-Reply-To: <20030604145901.GB766@apartia.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox