join two tables without a key

Поиск
Список
Период
Сортировка
От Dino Vliet
Тема join two tables without a key
Дата
Msg-id 375015.77819.qm@web51102.mail.re2.yahoo.com
обсуждение исходный текст
Ответы Re: join two tables without a key  (Raymond O'Donnell <rod@iol.ie>)
Re: join two tables without a key  (Jeremy Harris <jgh@wizmail.org>)
Re: join two tables without a key  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-general

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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Performance statistics
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: join two tables without a key