Hi! I have tblPerson in sql with data.
CREATE TABLE [dbo].[tblPerson](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](25) NULL,
[Category] [int] NULL,
[Salary] [float] NULL
)
Id
|
Name
|
Category
|
Salary
|
1
|
Rustam
|
1
|
50
|
2
|
Suhrob
|
2
|
30
|
3
|
Firuz
|
1
|
45
|
4
|
Sadriddin
|
3
|
40
|
5
|
Nurullo
|
2
|
35
|
select Name,Category, Salary, SUM(Salary)SumSalary from tblPerson group by Category,Name,Salary
I want use query get below result:
Id
|
Name
|
Category
|
Salary
|
SumSalary
|
1
|
Firuz
|
1
|
45
|
95
|
2
|
Rustam
|
1
|
50
|
3
|
Nurullo
|
2
|
35
|
65
|
4
|
Suhrob
|
2
|
30
|
5
|
Sadriddin
|
3
|
40
|
40
|
Summa
|
200
|