Grouping by day, limiting amounts

From: Mezei Zoltán <mezei(dot)zoltan(at)telefor(dot)hu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Grouping by day, limiting amounts
Date: 2006-10-19 11:51:55
Message-ID: 453766DB.6000408@telefor.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000099">
<font size="-1"><font face="Tahoma">Hi,<br>
<br>
I didn't really know what subject I should give.<br>
<br>
I have a table like this one:<small><br>
<br>
</small></font></font><small><font face="Tahoma">2006.10.01.    Bela  
 10<br>
2006.10.01.    Aladar    9<br>
2006.10.01.    Cecil    8<br>
2006.10.01.    Dezso    7<br>
2006.10.01.    Elemer    6<br>
2006.10.02.    Bela    11<br>
2006.10.02.    Aladar    10<br>
2006.10.02.    Cecil    9<br>
2006.10.02.    Dezso    8<br>
2006.10.02.    Ferenc    7<br>
2006.10.03.    Bela    6<br>
2006.10.03.    Aladar    5<br>
2006.10.03.    Cecil    4<br>
2006.10.03.    Dezso    3<br>
2006.10.03.    Jozef    2<br>
<br>
The first column is a date, the second is a name, the third is the
number of votes that the name received on that day.<br>
<br>
I would like to select the 3 (or 10) names with the most votes for each
day.<br>
<br>
Any suggestions on how can it be done easily?<br>
<br>
Thanks,<br>
<br>
Zizi<br>
</font></small>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.2 KB

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2006-10-19 12:30:19 Re: Grouping by day, limiting amounts
Previous Message Indira Muthuswamy 2006-10-19 06:58:58 Re: [HACKERS] Bug?