mysql - SQL: how to get a weighted count using GROUP BY? -


how can make query like:

select myvalue, count() freq mytable group myvalue; 

but freq sums values weight column instead of counting each row 1?

i'm using mysql 5.1.

select myvalue, sum(weight) freq mytable group myvalue; 

Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -