SQL LEAD Function

The SQL Server LEAD function is one of the Analytic functions. It allows you to access the data from a subsequent row without using any SELF JOIN or Subquery. The LEAD function is handy when comparing the current and next row values. The SQL Server LEAD function has to be followed by the ORDER BY … Read more