这里是我的查询:MYSQL计数 - 返回0,如果空
select COUNT(*) as total, COUNT(distinct user) as unique
FROM table
WHERE uristem in ('/example/', '/example/', '/example/', '/example/')
and time > DATE_SUB(NOW(), INTERVAL 24 HOUR)'
group by uristem;
应该是这样的
100 50
25 50
0 0
100 35
但是,如果没有计数,它看起来像这样(失踪)
100 50
40 50
100 35
我该如何填写0代替?
添加一些例子请记录。 –