Search Postgresql Archives

Re: "UNION ALL" is failing

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

 



Joy Smith <freestuffanddeals@xxxxxxxxx> writes:
> column types are the same so I don't know why this 'union all' is failing.

It's a syntax error --- got nothing to do with column types.

I think what you need to do is parenthesize the first subquery.  ORDER
BY isn't allowed to be attached to a UNION subquery otherwise.  You're
probably going to need to parenthesize the second subquery too ---
otherwise it will think that that ORDER BY applies to the UNION result,
not the subquery.

I don't offhand remember the syntactic precedence of WITH versus UNION,
but trying to attach WITHs to the subqueries might be another reason to
need parentheses.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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