Skip to content
Advertisement

SQL Query to remove duplicated data and take single column sum

I have the following table resulted from

but now I want to remove the repeated rows except the Sum of ‘TotalBill’.

enter image description here

Advertisement

Answer

Use GROUP BY:

Note that for the billing date, the two “duplicate” records you have highlighted have different dates. It is not clear which date, if any, you want to report here. I have omitted this column.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement