A SQL Question About distinct, limit, group by, having, aggregate

Поиск
Список
Период
Сортировка
От 林[鋅
Тема A SQL Question About distinct, limit, group by, having, aggregate
Дата
Msg-id 20050331022422.M58459@cyut.edu.tw
обсуждение исходный текст
Ответы Re: A SQL Question About distinct, limit, group by, having, aggregate  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-sql
i have a little question, how to get 3 higher score student in every class.
Data looks like as below

problem:
id        class        score
john        a        100
jenny        a        70
ken        a        59
mary        b        85
jacky        b        80
lily        b        70
kevin        b        50
david        b        30
tina        c        85
tony        c        80
bare        c        70
vivian        c        60
eric        c        57
andy        c        50

result:
id        class        score
john        a        100
jenny        a        70
ken        a        59
mary        b        85
jacky        b        80
lily        b        70
tina        c        85
tony        c        80
bare        c        70

--
http://alumni.cyut.edu.tw
Open WebMail Project (http://openwebmail.org)



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

Предыдущее
От: Chris Browne
Дата:
Сообщение: Re: New record position
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: A SQL Question About distinct, limit, group by, having, aggregate