Using a variable as a view name in a select - Mailing list pgsql-sql

From Wilkinson, Jim
Subject Using a variable as a view name in a select
Date
Msg-id 7CCC5BEF5E72394C963E529B54EB4A642A19B3@SD01ITMV12.PROD.NET
Whole thread Raw
In response to LOCK command inside a TRANSACTION  (Carlos Santos <carloscompels@yahoo.com.br>)
Responses Re: Using a variable as a view name in a select
Re: Using a variable as a view name in a select
List pgsql-sql

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 …

 

Create view as select * from table_X;

 

I need to do something like this …

 

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.

 

Any ideas ?

pgsql-sql by date:

Previous
From: Carlos Santos
Date:
Subject: LOCK command inside a TRANSACTION
Next
From: "A. Kretschmer"
Date:
Subject: Re: Using a variable as a view name in a select