oracle rank() over partition by queries

Поиск
Список
Период
Сортировка
От Ruben Gouveia
Тема oracle rank() over partition by queries
Дата
Msg-id 1219351357.27860.5.camel@dina2.dhcp.2wire.com
обсуждение исходный текст
Ответы Re: oracle rank() over partition by queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Does postgreSQL have an equivalent of the Oracle's "rank() over by
partition"?

Here's what i have so far but it doesn't work:

select id,
       sum(case when key = 5 then 1 else 0 end),
       sum(case when key = 6 then 1 when key = 7 then 1 else 0 end),
       sum(case when l.status = 6 then cost when key = 7 then cost else
0 end),
       RANK() OVER (ORDER BY sum(case when key = 6 then 1 when key = 7
then 1 else 0 end) DESC) AS RANK
from mytable
group by id

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

Предыдущее
От: Travis Smith
Дата:
Сообщение: Re: [ADMIN] Query performance difference
Следующее
От: Bill
Дата:
Сообщение: Text field truncated using ADO/ODBC?