Re: union and limit

Поиск
Список
Период
Сортировка
От Nigel J. Andrews
Тема Re: union and limit
Дата
Msg-id Pine.LNX.4.21.0208271028280.667-100000@ponder.fairway2k.co.uk
обсуждение исходный текст
Ответ на union and limit  ("Ben-Nes Michael" <miki@canaan.co.il>)
Список pgsql-general
On Tue, 27 Aug 2002, Ben-Nes Michael wrote:

> Hi All
>
> i tried to send the following querry:
>
> select * from table limit 3,0 UNION ALL select * from table limit 3,0;
>
> This querry returned me an error so i put each select in parenthesis and it
> worked.
>
> Is this the way to solve it ?
> if it is, i think it should be in the docs.


If you read carefully the syntax for the SELECT from

    http://developer.postgresql.org/docs/postgres/sql-select.html

you will see that the limit clause in the first select is not allowed
there. Don't forget the LIMIT applies to the entire result set not the last
select making up the union.

So in short, that is how it's supposed to work so there's no need to document
it.


--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants


В списке pgsql-general по дате отправления:

Предыдущее
От: "Jules Alberts"
Дата:
Сообщение: Re: how to count string occurrence in column
Следующее
От: "Ben-Nes Michael"
Дата:
Сообщение: Re: union and limit