牛骨文教育服务平台(让学习变的简单)
博文笔记

mysql的count查询中使用条件

创建时间:2014-04-02 投稿人: 浏览次数:2727

在mysql的count查询中加入条件,在mysql的count查询中加入条件,在mysql的count查询中加入条件,在mysql的count查询中加入条件,

 

 

 select count(pp_id),count(if(view_type="2",true,null )),count(if(bounce_type="1",true,null )),count(DISTINCT program_id),SUM(play_interval)   from v_calculate_play where app_id=app_id

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。