Re: Useful SQL-statement? - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: Useful SQL-statement?
Date
Msg-id 3F71D320.2000803@klaster.net
Whole thread Raw
In response to Useful SQL-statement?  (anssiman@jippii.fi (-anssi))
List pgsql-sql
> Hello!
> 
> Is there any standard SQL-statement, which produce
> resultset containing best plyers of the each team?
> 
> player |team|points
> -------------------
> paul    col   10
> peter   col   12
> steve   det   12
> sergei  det    8
> jere    dal    4

Sure:
select distinct on (team) player,team,points
from resultset
order by team asc, points desc

Regards,
Tomasz Myrta



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Especial delimiters caracter
Next
From: Richard Huxton
Date:
Subject: Re: Especial delimiters caracter