Search Postgresql Archives

Re: UNION not working... why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux