I have a table in my mysql db that has two columns: model and zone. See below.
Model zone
Car 1 A
Car 2 B
Car 3 A
Car 4 C
Car 5 A
Car 1 A
Car 2 B
Car 3 B
Car 4 B
Car 5 A
Car 11 C
Car 12 A
I am trying to get the number of records for each unique model/Zone.
This is what I expect:
Model A B C
Car 1 2 0 0
Car 2 0 2 0
Car 3 1 1 0
Car 4 0 1 1
Car 5 2 0 0
Car 11 0 0 1
Car 12 1 0 0
I want to get this count value of each model in each zone dynamically by mysql query.