Home Forums SQL Server 2008 SQL Server 2008 - General How to update Flag for maximum amount in a a group RE: How to update Flag for maximum amount in a a group
keebler96
Old Hand
Points: 300
More actions
July 10, 2013 at 7:33 am
#1631215
update #temp
set flag = 'Y'
from #temp
join (select lnno ,max(amount) amount from #temp group by lnno) temp2 on
#temp.lnno = temp2.lnno
and #temp.amount = temp2.amount