Mysql
 sql >> Database >  >> RDS >> Mysql

raggruppa per data, conferma, in attesa

SELECT Date, SUM(CASE Confirm WHEN 1 THEN 1 ELSE 0 END) Confirmed,
  SUM(CASE Confirm WHEN 0 THEN 1 ELSE 0 END) Pending,
 FROM Table
GROUP BY Date