Function "LEAD" not found.

36 views
Skip to first unread message

Hiro Protagonist

unread,
Jul 1, 2019, 2:48:54 PM7/1/19
to H2 Database
I am trying to use the SQL Window Function LEAD.

The statement looks like this:

SELECT id, lead(id) over (ORDER BY id ASC) AS id_succ FROM t ;

But I always get this error:

Function "LEAD" not found.

I don't see what I am doing wrong here. I can find LEAD in the documentation, but I don't understand why it does not work. Do I need to enable it somehow?

Here is the document reference:


Thanks for any help in advance. 

Evgenij Ryazanov

unread,
Jul 2, 2019, 2:11:51 AM7/2/19
to H2 Database
Hello.

Window functions aren't available in old versions of H2, only 1.4.198 and 1.4.199 have them. 1.4.198 has a lot of regressions, so use 1.4.199.

Online documentation in both HTML and PDF formats covers only the latest available version. When you use some older version you need to use the documentation from the ZIP distribution of that version.
Reply all
Reply to author
Forward
0 new messages