Re: sequencing two tables
От | Stephan Szabo |
---|---|
Тема | Re: sequencing two tables |
Дата | |
Msg-id | 20041128184032.D12412@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | sequencing two tables (Shachar Shemesh <psqll@shemesh.biz>) |
Ответы |
Re: sequencing two tables
|
Список | pgsql-general |
On Sun, 28 Nov 2004, Shachar Shemesh wrote: > I need to create a list of all rows of the combination of two tables. > For reasons I can't go into, I need this list to be in a single query, > and not write a function to do it. > > I thought about doing something like this: > select |COALESCE(table1.field, table2.field) as field from table1 full > outer join table2 on false > > There is just one small problem. Even though logically this does what > I'm trying to do, postgres says: > "FULL JOIN is only supported with merge-joinable conditions". > > I don't even understand the error message, much less whether I'm doing > anything wrong, and whether I'm missing something stupifyingly obvious here. We don't support join conditions like the above at this point. The message isn't terribly helpful though. Fortunately, I think some variant like select table1.field from table1 union all select table2.field from table2; will give you the output you're looking for.
В списке pgsql-general по дате отправления: