I have this table name "TB1" contain of these columns :
Bill.No Patient_Name Xray Price qty Doctor
1 Ronny Test1 100 2 Admin
1 Ronny Test2 200 3 Admin
2 Mina Test1 100 2 User
3 Roan Test4 400 1 Admin
4 Bedo Test3 50 1 User
4 Bedo Test3 50 1 User
5 Phill Test3 50 4 Admin
I need a group with Bill.NO with sum column qty ,price from "TB1" to be like this :
Bill.No Patient_Name Xray Price qty Doctor
1 Ronny Test1 300 5 Admin
Test2
2 Mina Test1 100 2 User
3 Roan Test4 400 1 Admin
4 Bedo Test3 100 2 User
Test3
5 Phill Test3 50 4 Admin
What I tried to do , I wrote this query but not doing as I want :
Select Bill.No, Patient_Name, Xray, sum(Price) as Price, sum(qty) as qty, Doctor
From TB1
group by Bill.No, Patient_Name, Doctor, Xray