Search Postgresql Archives

join two tables without a key

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

 



Hi postgresql list,


If I have two tables with the same number of rows but different columns and I want to create one table out of them what would be the way to do that in postgresql?




Table A has N number of rows and columns X,Y,Z and Table B has N number of rows and P,Q,R as columns. None of the tables have a column which can be used as a key. 

The resulting table should have N number of rows and X,Y,Z,P,Q,R as columns.



1) How to accomplish this is plain SQL? Join on rowid?

2) What would a PL-pgsql program look like to accomplish ths?

3) If N=10000000 and the two tables have 45 columns with mixed integer and character values, what would be the most efficient approach (fastest) and why?



Thanks in advanced




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux