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

GRUPPO MySQL Per conteggio

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