Re: count different values in column - Mailing list pgsql-sql

From Tod McQuillin
Subject Re: count different values in column
Date
Msg-id Pine.GSO.4.44.0204190439100.5488-100000@sysadmin
Whole thread Raw
In response to count different values in column  ("Albrecht Berger" <berger1517@gmx.ch>)
Responses Re: count different values in column
List pgsql-sql
On Fri, 19 Apr 2002, Albrecht Berger wrote:

> Now I want to count the different values in the column.
>
> Resulttable :
>    a
> ------
> 10
> 12
> 12
> 12
> 14
> 14
> 15
>
> I need the value which is repeated most in the resulttable (in this example
> 12 ) !

SELECT a, count(a) FROM resulttable GROUP BY a ORDER BY 2 DESC
-- 
Tod McQuillin





pgsql-sql by date:

Previous
From: "Albrecht Berger"
Date:
Subject: count different values in column
Next
From: "Gautham S. Rao"
Date:
Subject: Re: count different values in column