pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: David Pradier <dpradier@apartia.fr>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to make a IN without a table... ?
Date: Fri, 13 Jun 2003 15:04:14 -0600 (MDT)
Message-ID: <Pine.LNX.4.33.0306131503300.21088-100000@css120.ihs.com> (raw)
In-Reply-To: <20030612115027.GB680@apartia.fr>

On Thu, 12 Jun 2003, David Pradier wrote:

> On Thu, Jun 12, 2003 at 01:16:27PM +0200, Christoph Haller wrote:
> > >
> > > i ran today in a problem when doing some (i mean 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 :-/
> > >
> > What about using a TEMP TABLE?
> 
> I avoid as hell to use temporary tables. This is part of a complex
> database, with more than 250 different tables. So i don't even want to
> think about adding temporary tables, brrr !

Just FYI, temporary tables in pgsql are invisible to other connections 
even if they have the same name, and are auto-dropped when the connection 
is dropped.




view thread (14+ messages)  latest in thread

Message-ID: <Pine.LNX.4.33.0306131503300.21088-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0306131503300.21088-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0306131503300.21088-100000@css120.ihs.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@ihs.com, dpradier@apartia.fr, ch@rodos.fzk.de
  Subject: Re: How to make a IN without a table... ?
  In-Reply-To: <Pine.LNX.4.33.0306131503300.21088-100000@css120.ihs.com>
  References: <20030612115027.GB680@apartia.fr> <Pine.LNX.4.33.0306131503300.21088-100000@css120.ihs.com>

* 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