Re: UNION not working... why?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: UNION not working... why?
Дата
Msg-id 4761628F.4070002@archonet.com
обсуждение исходный текст
Ответ на UNION not working... why?  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Список pgsql-general
Stefan Schwarzer wrote:
> Hi there,
>
> I have two rather simple queries, which I would to UNION, but somehow I
> always get an error message for the UNION ("ERROR:  syntax error at or
> near "UNION"")

> SELECT
> ORDER BY
> LIMIT 1
>
> UNION ALL
...

I think it's complaining about the order by/limit. The UNION is part of
the standard SELECT grammar and has its own ORDER BY (if you see what
I'm getting at).

Try SELECT * FROM (SELECT ... ORDER BY) AS foo UNION ...


--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Stefan Schwarzer
Дата:
Сообщение: UNION not working... why?
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: UNION not working... why?