Hi Andy,

I'm not sure if I entirely understood your question, but I think you're
looking for something like this:

select
    concat(date,':',uid),
    sum(1) as total,
    sum(if(a=1,1,0)) AS ca,
    sum(if(b=1,1,0)) AS cb,
    sum(if(c=1,1,0)) AS cc
from mytable
group by uid, date;

Query like this allows you to efficiently compute sums of multiple columns
in a single map-reduce.

Best regards,
Jan
On Wed, Mar 27, 2013 at 4:34 AM, 周梦想 <[EMAIL PROTECTED]> wrote:
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB