I am working for a company that still uses MS SQL Server 2008 R2 and so I cant use Lead/Lag Functions.
I know the general workaround of sub queries with partitions etc to replicate what this does but i am working on a project that requires lots and lots of leads and lags to be used.
Therefore my question is has anybody come up with a smart way of replicating what a lead function does that could be called from a UDF etc that would make this process easier?