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
Post a Comment