Hi Digs
consider the following table:
create table #test(id char(1),value int)
insert #test
select 'A', 2000
union all
SELECT 'A',3000
union all
SELECT 'A',1000
union all
SELECT 'A',1500
union all
SELECT 'B',1000
union all
SELECT 'C',5000
union all
SELECT 'C',1000
I think this is what you need:
select id,max(value)
from #test
group by id
but if the desire result is exactly as what you have shown,do the following snippet :
select T.*,A.maxval
from
#test T
inner join
(select id,max(value)
from #test
group by id) A(id,maxval)
on A.id=T.id