I have a table which is update has some fields with repeating data. I want to roll up this data to summarize it. How do I do this for SQL Server? I have an example of the output and structure below. I've tried some different joins but I've seen repeating data and some errors that I don't understand.
Table structure
- Logfile name (string)
- Status (int) - could be 1, 2, 3 depending on app input
Data
f1, 3, 0
f1, 2, 1
f1, 3, 0
f2, 1, 1
f2, 1, 1
f2, 2, 1
....
Output
File | Count of status == 1 | Count of status == 2
f1 | 59 | 43
f2 | 28 | 99
f3 | 23 | 16