MySQL查询某个字段为某值的次数统计SQL语句

SELECT GoodID,sum(if(Level = 1, 1, 0)) as Better,sum(if(Level = 0, 1, 0)) as Nomal,sum(if(Level = -1, 1, 0)) as Bad from evaluates GROUP BY GoodID;

  

posted @ 2015-08-13 10:38  yesicoo  阅读(4710)  评论(0编辑  收藏  举报