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

From Christoph Haller
Subject Re: count different values in column
Date
Msg-id 200204190946.LAA12543@rodos
Whole thread Raw
In response to count different values in column  ("Albrecht Berger" <berger1517@gmx.ch>)
List pgsql-sql
select max(count) from (
select a, count(a) from Resulttable group by a 
) as foo; max
-----  3
(1 row)
should do it. 
Regards, Christoph 

> Hello,
> today I have a new question :)
> 
> I've a resulttable is generated by a couple of subselects and joins which
> contains only one column.
> 
> 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 ) !
> 
> 
> Any suggestions ?
> 
> 
> Thx
> berger
> 


pgsql-sql by date:

Previous
From: "Gautham S. Rao"
Date:
Subject: Re: count different values in column
Next
From: Fduch the Pravking
Date:
Subject: Re: count different values in column