Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MYSQL select count by value

SELECT date,
       COUNT(*),
       COUNT( IF( value = 1, 1, NULL ) ),
       COUNT( IF( value = 2, 1, NULL ) )
FROM my_table