I am having some trouble wrapping my head around this one.
I have a Cars Database with a Class field that when selecting all entries, it will have duplicates of each Class value. What I need to do with that is to count all of duplicates for each Class value and then remove the duplicates to only display each Class value once with a custom fields with the counted amount.
Class
-----
A3
A3
A3
A3
B2
B2
To become:
Class | Count
------+---------
A3 | 4
B2 | 2
I could imagine something contain the Count() method, but I have no idea how I could have it count only the duplicate values and return the values separately for each Class value?
Thanks in advance for any help in this one.
1 Answer