Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 4A80A9FBA23 for ; Tue, 3 Apr 2007 10:16:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 86076-08 for ; Tue, 3 Apr 2007 10:16:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by postgresql.org (Postfix) with ESMTP id 691309FBA22 for ; Tue, 3 Apr 2007 10:16:43 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1HYisJ0upo-0000ks; Tue, 03 Apr 2007 15:16:39 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HYisI-0002yc-00 for pgsql-sql@postgresql.org; Tue, 03 Apr 2007 15:16:38 +0200 Date: Tue, 3 Apr 2007 15:16:38 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Using a variable as a view name in a select Message-ID: <20070403131638.GF30108@a-kretschmer.de> References: <141386.39515.qm@web57105.mail.re3.yahoo.com> <7CCC5BEF5E72394C963E529B54EB4A642A19B3@SD01ITMV12.PROD.NET> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7CCC5BEF5E72394C963E529B54EB4A642A19B3@SD01ITMV12.PROD.NET> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX19t0l3lCoK0WljxfZqEHJFlaFfCMEQdnHHTVJQ xsutaehd8V+FgLIylVEeIMFiSMTiPdaSUFAu9K5e+OUU+GJlmg RayBfGNLBHxEuj2+6G7+RMeTHZYQFab X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/28 X-Sequence-Number: 28028 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