Posted by: virusno1 August 27, 2014
SQL Select Statement
Login in to Rate this Post:     0       ?        
SQL_PRO, i don't think you should be using rank function. Can you try using only ANSI SQL :)?
Btw, if you are using sql 2012 this thing can be done with ease
Select * from
(select steps as StepsFrom,lead(steps) over (order by steps) as StepsTo from #table1 ) t1
where StepsTo is not null

But ANSI SQL would be more interesting :)
Read Full Discussion Thread for this article