| От | Tom Lane |
|---|---|
| Тема | Re: Re: "Oracle's ROWNUM" |
| Дата | |
| Msg-id | 21527.996516732@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Re: "Oracle's ROWNUM" (Barry Lind <barry@xythos.com>) |
| Список | pgsql-general |
Barry Lind <barry@xythos.com> writes:
> ... For example rownum = 2 will return
> no rows because the first row returned by the query has by definition a
> rownum of 1, but the where predicate prevents this row from being
> returned, thus it can never get to a rownum value of 2 to satisfy the
> where predicate.
So in other words, a construct accessible in the WHERE clause is defined
in terms of what happens far downstream of WHERE. This cannot possibly
have sane behavior. I won't even ask about join queries...
AFAICT, LIMIT/OFFSET do the same job in a much more logical fashion.
Let's stick with those, and not try to copy the more brain-dead aspects
of Oracle.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера