Reputation: 474
I have Creating more than 10000 lines Using SQL Server.I inserted Many values.Now i want sum of Total based Expensive type value .
ExpenseTypeCode ExpenseType
700300 Meals - FBR Only
700450 Taxis/Parking/Tolls
700450 Taxis/Parking/Tolls
700300 Meals - FBR Only
700300 Meals - FBR Only
i have this two fields and values.Now i want Sum of total using Expense type value .I want separate Total Like Taxis/Parking/Tolls
total .how can calculate total based column value ?
Upvotes: 1
Views: 41
Reputation: 908
simply you can do like this
select ExpenseType,Total=Sum(ExpenseTypeCode) from YourTable
group by ExpenseType
Upvotes: 1