SQL Fundamentals — Hard
Key points
- LAG function looks back a specified number of rows
- Default value is only used when there are not enough rows to look back
- The function returns the salary of the row 2 positions before the current row
Ready to go further?
Related questions
