Below are the list data.
Code ItemCount Type Amount ---------------------------------------- B001 1 Dell 10.00 B001 1
You can try this query:
SELECT Code,SUM(ItemCount) AS ItemCount,Type,SUM(Amount) AS Amount FROM table GROUP BY Code, Type
This will give you proper result. You need to group by Code and Type and not ItemCount
Code
Type
ItemCount