dynamic name of table in select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi to all,
I need help about the following issue:
in my db I've three table which have the same column (there are some reasons
for that) I'd like to perform a select statement like that: select my_column
from xxx_table . 
Where xxx could be choosen from another table result. 
for example :

select my_column from (select name_table from catalog where condition1)

now the internal select has to return the name of the table which is linked
to the condition1 (let me say condition1_table) so after the inner select
has been perfomed, I should have 

select my_column from condition1_table

Is it possible ?

Second question: is there a system variable where the name of the db is
stored ? how can I recall it?

Thanks in advance and best regards

Giu 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Realizza i tuoi sogni con i finanziamenti Finatel! Fino a 50.000 Euro senza
spese in pochissimo tempo. Richiedi Informazioni 

 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7371&d=20080103



---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux