mysql count() 條件語句

SELECT    no,   COUNT(1) AS all_num,   COUNT(CASE WHEN is_com = 1 THEN is_com END) AS com_num,   COUNT(CASE WHEN is_com = 0 THEN is_com END) AS not_com_num  FROM   data a  WHERE 1=1 GROUP BY no   co
相關文章
相關標籤/搜索