Assuming col3 will always be sequential you can do thisSELECT t2.*FROM table t1INNER JOIN table t2ON t2.col3 = t1.col3 - 1WHERE t1.col2 ='ODP Inspection'
In case col3 has gaps. you need this;With CTEAS(select *,row_number() over (order by col3) as seqfrom table)SELECT t2.col1,t2.col2,t2.col3FROM CTE t1INNER JOIN CTE t2ON t2.seq = t1.seq - 1WHERE t1.col2 ='ODP Inspection'
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs