Question: Explain the purpose of the SQL LEAD() and LAG() functions.Answer: The LEAD() function is used to access the next row's data in the result set, while the LAG() function is used to access the previous row's data.Example:
|
Is it helpful?
Yes
No
Most helpful rated by users:
- What is SQL?
- What is the difference between SQL and MySQL?
- What is a primary key?
- What is an index in a database?
- What is a foreign key?