在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
本文介绍如何在MySQL中使用COUNT函数进行复杂查询,包括如何结合条件筛选进行聚合统计,例如统计特定条件下记录的数量、唯一值数量及求和等操作。
699

被折叠的 条评论
为什么被折叠?



