Select in From clause - Mailing list pgsql-sql

From Ray Madigan
Subject Select in From clause
Date
Msg-id IIEPJABILGOCODDLDNJFGENDCEAA.ray@madigans.org
Whole thread Raw
Responses Re: Select in From clause  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Select in From clause  ("Bart Degryse" <Bart.Degryse@indicator.be>)
List pgsql-sql
I have never seen this done before, but it seems like it is supposed to work
from reading the manual.

I want to be able to get a table name from another table and use it in the
from clause of a select.

Something like

SELECT * FROM (SELECT name FROM bar WHERE conditions) AS b WHERE b.condition
= xxx;

which translates to something like

SELECT * FROM Dealer AS b WHERE b.zipcode = 12345;

The translated version works but the SELECT in FROM version reports that
b.condition does not exist.



pgsql-sql by date:

Previous
From: Keith Carr
Date:
Subject: Re: Temporal databases
Next
From: Alvaro Herrera
Date:
Subject: Re: Select in From clause