add to table which name is in table

Поиск
Список
Период
Сортировка
От teknet@poczta.onet.pl
Тема add to table which name is in table
Дата
Msg-id 20040717074205Z135895-30879+518592@kps2.test.onet.pl
обсуждение исходный текст
Ответы Re: add to table which name is in table  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-admin

Hello

i have table:

create table table_names (
id                      SERIAL,
name                VARCHAR(75) NOT NULL
);

 

and for each name in table_names i have table (which name is name field from table_names).

So in table_names i have records:

1 table1

2 table2

3 table3

 

So i have three other tables named: table1 table2 table3.

And i want to operate on that tables by reading their names from table_names. I tried:

select * from (select name from table_names where id=1) as something;

but i received only:

 table_names
--------------
 table1
(1 row)

And i wanted to receive everything from table1.

How can i do it ?

 

Thanx

Michal

В списке pgsql-admin по дате отправления:

Предыдущее
От: mike g
Дата:
Сообщение: Re: inheritance question
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: add to table which name is in table