Hi Andy,

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

    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,
On Wed, Mar 27, 2013 at 4:34 AM, 周梦想 <[EMAIL PROTECTED]> wrote: