-1

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?

Dharman
  • 30,962
  • 25
  • 85
  • 135
sairamdgr8
  • 47
  • 1
  • 10

1 Answers1

0

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.

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828