subselects? - Mailing list pgsql-novice

From Knut P. Lehre
Subject subselects?
Date
Msg-id 5.1.0.14.2.20030423165621.02145670@uio-pop.uio.no
Whole thread Raw
Responses Re: subselects?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
In a table (T1) there are several columns. Two of them together make up a
link to any row in the same database: one column (T1C5) is a string
representing the name of a table, and the other (T1C6) an int representing
the id of a row in the table referred to in T1C5.
I want to write a query returning some columns from T1,
(T1C1,T1C2,T1C3,T1C4), and in the same result row, all of the columns from
the table with its name in T1C5 with and id in T1C6.
A simple select query using a join like (SELECT * FROM a LEFT JOIN b ON
(a.ref = b.id);) could be used if all the table names in the T1C5 column
were the same. However, they are not. Any suggestions on how to solve this
problem?

Thanks, KP


pgsql-novice by date:

Previous
From: "Brian Gustin"
Date:
Subject: building postgre on existing server
Next
From: fabrice
Date:
Subject: stored procedure from Access