Category Archives: T-SQL

When the Performance of LAG Lags Behind

My favorite T-SQL windowing functions are LAG and LEAD. LAG and LEAD let you take a peek at another row and grab any column you need in your results. They are easy to use and perform great…except when they don’t. … Continue reading

Posted in T-SQL, T-SQL Window Functions | Leave a comment

New Post on SQL Authority

Over the past year, Linchpin People consultants have contributed to Pinal Dave’s popular SQL Authority site in the Notes From the Field¬†series. Since I am new to Linchpin People, I just got in the rotation and contributed the 52nd installment. … Continue reading

Posted in T-SQL | Leave a comment

Is ROW_NUMBER() non-deterministic?

I have presented my T-SQL Window function presentations for a couple of years. I love it when interesting questions come up during the session. Recently, during my intro session, I was showing the difference between ROW_NUMBER, RANK, and DENSE_RANK by … Continue reading

Posted in T-SQL, T-SQL Window Functions | Leave a comment