Hope you are doing well!...I am trying to find the sum of sales by ID and returning only the max of the name as there are multiple names for a single ID..Please find the DDL for the input and the output tables..Can you please help me here..
Create table ##input
insert into ##input values
('3051'Department of psychology ','382'),
('3051'psychology department of medicine','4087')
create table ##output
insert into ##output values
('3051','psychology department of medicine',4469')