select
COUNT(t.registered_machine) id,
DATE_FORMAT(t.create_time,'%Y-%m-%d') addDate,
-- COUNT(DISTINCT IF(t.registered_machine = 'android',t.id,NULL)) android,
-- COUNT(DISTINCT IF(t.registered_machine = 'h5',t.id,NULL)) h5,
-- COUNT(DISTINCT IF(t.registered_machine = 'ios',t.id,NULL)) ios,
COUNT(DISTINCT IF(t.registered_machine = 'pc',t.id,NULL)) pc
from user_register_info t
where 1=1 GROUP BY t.create_time
数据库判断是否为某一个值时sql
最新推荐文章于 2024-06-12 16:57:15 发布