Re: Basic SQL join question

Поиск
Список
Период
Сортировка
От Arjen van der Meijden
Тема Re: Basic SQL join question
Дата
Msg-id b1desm$cjd$1@news.tudelft.nl
обсуждение исходный текст
Ответ на Basic SQL join question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список pgsql-general
Jean-Christian Imbeault wrote:
> Sorry for this simple question but I can't seem to get Postgres to do
> what I want ...
>
> I want to get the concatenation of 2 or more tables with absolutely
> nothing in common. How can I do this?
You can't, or at least you shouldn't.
If you want to display them inline in your application, try building
some clientside code to display het pretty.

But since there is no relation, the database will never be able to
understand how to put the data together.

>
> For example
>
> Table a:
>
>    a
> -----
>   a1
>   a2
>   a3
>
> Table b:
>
>    b
> -----
>   b1
>   b2
>
> Table c:
>
>    c
> -----
>   c1
>   c2
>   c3
>   c4
>
> What is the proper SQL to return:
>
>    a |  b |  c
> ---------------
>   a1   b1   c1
>   a2   b2   c2
>   a3        c3
>             c4

As far as I know there is no SQL to return that :)

Regards,

Arjen


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Weird query plans for my queries, causing terrible performance.
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Basic SQL join question