Reputation: 73
I have a set of data of cars as follow:
| class | car |
| S | Hilux |
| M | Hilux |
| M | Toyota|
| M | Hilux |
| S | toyota|
| S | toyota|
| L | toyota|
And I want to show as per below:
| class | Hilux | Toyota |
| S | 1 | 2 |
| M | 2 | 1 |
| L | 0 | 1 |
How can it be done using Ms Access?
Upvotes: 0
Views: 30
Reputation: 3656
This might work:
TRANSFORM COUNT(car)
SELECT class
FROM Table_name
GROUP BY class
PIVOT car;
Upvotes: 1