I have a table like this
date | text | link_id
------------+-------+----------
05-10-2014 | lorem | 2
06-10-2014 | lorem | 4
05-10-2014 | lorem | 4
05-10-2014 | lorem | 5
05-10-2014 | lorem | 5
05-10-2014 | lorem | 5
05-10-2014 | lorem | 5
05-10-2014 | lorem | 5
05-10-2014 | lorem | 6
05-10-2014 | lorem | 4
I need to get the count of group from my rows here the result
date | text | link_id | value
------------+-------+----------+-------
05-10-2014 | lorem | 2 | 1
06-10-2014 | lorem | 4 | 3
05-10-2014 | lorem | 5 | 6
and why if I use function
COUNT(DISTINCT n)
or only
COUNT()
it always forces me to add all SELECT statement to GROUP
and I'm only Distinct 1 row