I have following table
opposition | dismissals
--------------+-------------
Australia | lbw
South Africa | run_out
England | bowled
Australia | run_out
England | lbw
I want to print output as follows
Opposition | lbw | run_out | bowled
--------------+-------+----------+-------
Australia | 1 | 1 | 0
England | 1 | 0 | 1
South Africa | 0 | 1 | 0
I cannot figure out how to use row values as column name and the print corresponding count. Can anyone can suggest in mysql how to do it? I am stuck at this question for days now. Even tried googling but I couldn't find anything.