Hi, 

Sounds more like a general PostgreSQL question rather than a PostGIS one. 

However, I guess you could build the list of unique variables as a string using 
queries on catalog tables embbeded in a PLPG function (or any other language 
depending on your work environment). 

Regards, 
Hug 






De: "Shaozhong SHI" <[email protected]> 
À: "PostGIS Users Discussion" <[email protected]> 
Envoyé: Jeudi 19 Novembre 2020 11:08:17 
Objet: [postgis-users] join multiple tables by id, and select all 

Hi, I tried the following for joining multiple tables by id, and select all 
into a new table. 
However, it will not work because id gets repeated. How to select all except 
one column? 

select a.*, b.*, c.*, d.* 
into new_table 
from a_table a 
join b_table b on [ http://a.id/ | a.id ] = [ http://b.id/ | b.id ] 
join c_table c on [ http://a.id/ | a.id ] = [ http://c.id/ | c.id ] 
join d_table d on [ http://a.id/ | a.id ] = [ http://d.id/ | d.id ] 

Looking forward to hearing from you. 

Regards, 

David 



[Fichier texte:ATT00001] 
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to