I have the following table and am trying to count the number of actions each user has performed.
----------------------------------
| ID | User | Action |
----------------------------------
| 1 | BobDoe | View |
| 2 | BobDoe | Edit |
| 3 | JaneDoe | Comment |
| 4 | BobDoe | Comment |
| 5 | JohnSmith | Edit |
| 6 | JaneDoe | Edit |
| 7 | JohnSmith | Comment |
| 8 | BobDoe | View |
----------------------------------
Currently I use the following query to just get the number of edits, but I'm wanting to change it so it counts comments and views and displays them in their own columns, I have no clue how I'd go about counting them each separately without having to make an entirely new query.
SELECT Type, User, COUNT(*) AS Num FROM some_database GROUP BY User
Any ideas?
Typeis isAction, sorry I had changed the name and forgot to update it in the example I posted.