join two tables without a key

Поиск
Список
Период
Сортировка

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



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