Ranking?

Поиск
Список
Период
Сортировка
От Sjors
Тема Ranking?
Дата
Msg-id 000801c3837c$100ff350$04a779d9@cc299057a
обсуждение исходный текст
Ответы Re: Ranking?  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-novice
Hi list,
 
Wondering if you could help me out here? I've got a table like this:
 
id    name    data
1    sully        567
2    sully        789
3    sully        456
4    denan       890
5    denan        678
 
now I want to have this:
 
id    name    data    rank
1    sully        567    2
2    sully        789    1
3    sully        456    3
4    denan       890    1
5    denan        678    2
 
I'm think along the lines with count, something like this:
 
select id,name,data, (select count (names) from table as tmp where data.tmp > data.table) as rank
 
this (I know) is not correct. What would be?
 
Greetings sjors
 

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

Предыдущее
От: Jonathan Telep
Дата:
Сообщение: Backing Up a Postgres database...
Следующее
От: Owen Funkhouser
Дата:
Сообщение: Difficult select statement