Re: Planning aggregates which require sorted or distinct
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Planning aggregates which require sorted or distinct |
| Дата | |
| Msg-id | 10346.1169276747@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Planning aggregates which require sorted or distinct (Gavin Sherry <swm@alcove.com.au>) |
| Ответы |
Re: Planning aggregates which require sorted or distinct
Re: Planning aggregates which require sorted or distinct |
| Список | pgsql-hackers |
Gavin Sherry <swm@alcove.com.au> writes:
> We want to answer the following: for each employee: what is their rank in
> terms of salary and what is their rank in terms of age. This query
> answers that:
> select empno, rank() over (order by salary) as srank,
> rank() over (order by age) as arank
> from employees order by empno;
Eeek. This seems like the worst sort of action-at-a-distance. How does
rank() know what value it's supposed to report the rank of?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера