I have a table and would like to count the appearance of the values (no sum)
ID status
============
1 2
2 3
3 1
4 1
5 1
6 2
and I need following result:
status_1 status_2 status_3 status_4
===================================
3 2 1 0
Can I do this with a single SQL statement?