UNION and LIMIT issue

Поиск
Список
Период
Сортировка
От Howard Smith
Тема UNION and LIMIT issue
Дата
Msg-id 469FDF17.9060701@visualmining.com
обсуждение исходный текст
Ответы Re: UNION and LIMIT issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Jyoti Seth"
Дата:
Сообщение: Re: Database Synchronization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: UNION and LIMIT issue