Howard Smith <[EMAIL PROTECTED]> writes:
> SELECT name,quantity FROM fruit limit 3
> UNION
> select name,CAST(SUM(quantity) as integer) from (
> select Cast('Other' as varchar) as name,quantity from fruit
> limit ALL offset 3
> ) w group by name
You need parentheses:
(SELECT ... limit 3) UNION ...
ISTM that a LIMIT without an ORDER BY is a pretty bad idea, btw.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org