• TomThomson (9/27/2015)


    paul s-306273 (9/23/2015)


    ...thought MS had made it reasonably easy to determine what LAG and LEAD do. For those using the language it's just plain English.

    The rows that lead the current row are the subsequent rows, ie the rows that come after it. If leading means coming behind, the SQL use of LEAD is indeed just plain English, but it's news to me that it means that. In fact in English it normally means the opposite of that.

    Of course that's no excuse for not knowing what LEAD and LAG do in SQL - it is indeed just plain SQL, but despite its original name (Structured English Query Language) plain SQL is very different from plain English.

    +1 you have provided an explanation easy to understand ( and more important to remember )

    ==> Thanks ....