do you mean aresult like this?declare @Sample table (ActivityID int, modid int, priority int, duedate datetime)insert @Sampleselect 23, 12,1,'20110512' union allselect 34, 12,5,'20110523' union allselect 63, 12,5,'20110523' union allselect 77, 12,5,'20110523' union allselect 89, 12,5,'20110523' union allselect 90, 12,6,'20110531' union allselect 112,12,7,'20110607'selectdense_rank() over (partition by modid order by priority asc) as new_prio,* from @Sample
No, you're never too old to Yak'n'Roll if you're too young to die.