См. Следующий код для справки
declare @tab table (DepartID integer, Name1 varchar(50))
declare @tab1 table (ID integer,DepartID integer, value1 float)
insert into @tab
select 1,'Sandy'
union all
select 2,'Ramesh'
union all
select 3,'Rani'
insert into @tab1
select 1,1,26.5
union all
select 2,1,29.0
union all
select 3,1,15.66
union all
select 4,2,60.3
union all
select 5,2,60.4
union all
select 6,3,10.0
union all
select 7,3,90.0
--select * from @tab
--select * from @tab1
select t.DepartID,max(t1.value1) as Rate
from @tab t
join @tab1 t1 on t.DepartID = t1.DepartID
group by t.DepartID
select t.DepartID,(select max(t1.value1) from @tab1 t1 where t1.DepartID = t.DepartID) as Rate
from @tab t
Результат:
DepartID Rate
1 29
2 60.4
3 90