Re: Can I unite 2 selects?

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Can I unite 2 selects?
Дата
Msg-id 54CA879C.7050805@hogranch.com
обсуждение исходный текст
Ответ на Can I unite 2 selects?  ("Sterpu Victor" <victor@caido.ro>)
Список pgsql-general
On 1/29/2015 10:58 AM, Sterpu Victor wrote:
> Can I write a query where I receive a single result set from many queries?
> Something like this: SELECT (SELECT 1 AS t1, 2 AS t2), (SELECT 3 AS t3)
> I tried exactly this but the error is: "ERROR:  subquery must return
> only one column"
> But I don't see why it must have only one column.

do you want

     1 | 2 | 3

or

     1
     2
     3

as your result?  the first is a join, the 2nd is a union.

--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



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

Предыдущее
От: Edson Richter
Дата:
Сообщение: Re: Can I unite 2 selects?
Следующее
От: Bill Moran
Дата:
Сообщение: Re: 4B row limit for CLOB tables