mysql一次查詢返回同一個字段的多個不一樣值關於count的使用!

SELECT COUNT(`online_status`=3 or null) as alarmCounts , COUNT(`online_status`=2 or null) as faultCounts , COUNT(*) as tatolCounts FROM fire_device Count在 值是NULL是 不統計數, 至於加上or NULL , 很像其餘編程裏的or運算符,
相關文章
相關標籤/搜索