Re: Using a variable as a view name in a select

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Using a variable as a view name in a select
Date: 2007-04-03 13:16:38
Message-ID: 20070403131638.GF30108@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am Tue, dem 03.04.2007, um 9:04:00 -0400 mailte Wilkinson, Jim folgendes:
> I have created a view, called april_may. I need to select this view by
> combineing to fields in the database to create the view name etc ?

Please, no answer to an other mail and change the subject to a new
subject. Your mail sorted in the wrong thread.

> Select * from (select table.start_month||_||table.end_month);
>
> ==================
>
> Start_month = april
>
> End_month = May
>
>
>
> What I what to pass to the select is the combination of the 2 fields as the
> view name.

Perhaps with a function that receive start and end and returns the
result as a table (set-returning function)

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message John Summerfield 2007-04-03 13:21:35 Re: Using a variable as a view name in a select
Previous Message Wilkinson, Jim 2007-04-03 13:04:00 Using a variable as a view name in a select