This?declare @t table (UniqueID int identity(1, 1), PolicyID int, CreateUser int, CreateDate datetime)insert @t select 1, 1, getdate()union all select 1, 2, getdate()-2union all select 1, 3, getdate()-1union all select 2, 2, getdate()union all select 2, 1, getdate()-1union all select 3, 1, getdate(); with t1 as (select *, row_number() over (partition by PolicyID order by CreateDate) as row from @t)select PolicyID, max(case when row = 1 then CreateUser end) as EarliestCreateUser, max(case when row = 1 then CreateDate end) as EasliestCreateDate, max(case when row = 2 then CreateUser end) as NextEarliestCreateUser, max(case when row = 2 then CreateDate end) as NextEasliestCreateDatefrom t1 group by PolicyID
Ryan Randall - Yak of all tradesSolutions are easy. Understanding the problem, now, that's the hard part.