分组统计(group by)时 条件统计某列值的行数

写道
//分组统计时 条件统计某列值的行数
String sql = "select UserId,count(case TrueFalse when true then UserId end) as rightAnswer,"+
"count(case TrueFalse when false then UserId end) as errorAnswer "+
from evastatistics GROUP BY UserId";
 

猜你喜欢

转载自yangchunhe.iteye.com/blog/1319189
今日推荐