I have a table with data as follows,
detectDate |isp |infection | count
--------------------------------------
2012-10-02 01:00|aaaa |malware |3
2012-10-02 01:30|bbbb |malware |2
2012-10-02 01:33|bbbb |spy-eye |2
2012-10-02 01:45|aaaa |DDos |1
2012-10-03 01:50|cccc |malware |2
2012-10-03 02:00|dddd |TDSS |2
2012-10-03 04:50|dddd |TDSS |3
I need to get an out put like this, grouped by date and infection like so,
detectDate |infection | count
--------------------------------------
2012-10-02 |malware |5
2012-10-02 |spy-eye |2
2012-10-02 |DDos |1
2012-10-03 |malware |2
2012-10-03 |TDSS |5
I know how to use group in general but not his far 🙁 can you please help me I need to group by date and infection and get the total of the count field as shown.
Use
SUMfunction to sumcountcolumn and useDATE_FORMATfunction to group by only date.See this SQLFiddle