subselects?
| От | Knut P. Lehre |
|---|---|
| Тема | subselects? |
| Дата | |
| Msg-id | 5.1.0.14.2.20030423165621.02145670@uio-pop.uio.no обсуждение исходный текст |
| Ответы |
Re: subselects?
|
| Список | 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 по дате отправления: