数据库判断是否为某一个值时sql

xiaoxiao2021-02-28  57

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
转载请注明原文地址: https://www.6miu.com/read-56601.html

最新回复(0)