Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is H2 Database able to make SQL query of the over clause with Aggregate function?

such SQL like

SELECT empno, deptno, 
COUNT(*) OVER (PARTITION BY deptno) DEPT_COUNT FROM emp WHERE deptno IN (20, 30);

is very useful.

I just wonder if in H2, how do we implement the similiar function? Maybe creating a java procedure will work. But will this function be inside the roadmap of H2 database?

like image 565
Clark Bao Avatar asked Oct 11 '22 20:10

Clark Bao


1 Answers

There is no support for windowing functions in H2.

This has been discussed recently in the H2 forum:

http://groups.google.com/group/h2-database/browse_thread/thread/3899106a85851de3#

like image 124
a_horse_with_no_name Avatar answered Oct 14 '22 03:10

a_horse_with_no_name