I'm trying to consolidate inventory records in db. (I'm displaying the result in a table form but for this post I'm putting it simple)

table_name= PC:
department - msoffice
IT - 2000
IT - 2002
IT - 2000
SNM - 2000
SNM - 2003
Finance - 2003
-----------------------------------

expected output:
msoffice - dept - qty
2000 - IT - 2
2000 - SNM - 1
2002 - IT...