sql >> Base de Datos >  >> RDS >> Mysql

GRUPO MySQL Por conteo

SELECT FROM, TO, COUNT(*) AS howmany,
       SUM(Type = 'Call_In') AS Call_In, SUM(Type = 'Call_Out') AS Call_Out
FROM table
GROUP BY FROM, TO