I'm not able to execute LEAD and LAG Functionality in MYSQL.
Do I need to install anything in MySQL Workbench to work it properly?
I'm not able to execute LEAD and LAG Functionality in MYSQL.
Do I need to install anything in MySQL Workbench to work it properly?
MySQL Workbench is just a client. It has no support for SQL (in the sense of parsing and executing SQL), much less LEAD() and LAG() functions. Clients just send your queries to the MySQL Server to be executed.
MySQL Server 8.0 has support for LEAD() and LAG() functions. See documentation here: https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html
If you have an older version of MySQL Server, you need to upgrade to get support for LEAD() and LAG() and other window functions.
You can confirm the version of your MySQL Server by running this query:
SELECT VERSION();
Note that you may be using MySQL Workbench 8.0, but connecting that client to MySQL Server of some different version.