UNION and LIMIT issue - Mailing list pgsql-sql

From Howard Smith
Subject UNION and LIMIT issue
Date
Msg-id 469FDF17.9060701@visualmining.com
Whole thread Raw
Responses Re: UNION and LIMIT issue  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
in pgsql 8.2 using LIMIT with UNION is throwing errors...

table is
-------------------------------

name                       quantity
character varying     integer
-------------------------------
Banana                   10
Cherry                    10
Apple                     5
Persimmon              3
Mango                    2

the query :
     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

throws an error on the UNION. Removing the first 'Limit 3' fixes the query,
but i need the limit statement. Anybody seen this behavior?

-- 
Howard Smith
professional services engineer
Visual Mining Inc
15825 Shady Grove Road, Suite 20
Rockville, MD 20850
tel 301.795.2239  fax 301.947.8293


pgsql-sql by date:

Previous
From: "Jyoti Seth"
Date:
Subject: Re: Database Synchronization
Next
From: Tom Lane
Date:
Subject: Re: UNION and LIMIT issue