You can translate the question and the replies:

Error while executing query

Facing error while executing the below query SELECT AQ_1.COL_1,AQ_1.COL_2,AQ_1.COL_3 OVER(ORDER BY AQ_1.COL_1 ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM ( SELECT TC_1."col1" COL_1, TC_1."col2" COL_2, SUM(TC_1."col3") COL_3, AVG(TC_1."col4") COL_4 FROM "tablename" TC_1 GROUP BY 1, 2 ) AQ_1 Syntax error: Exception parsing query near '(' But it looks like there is no syntax error...kindly help me on this.
user
03-07-2023 05:20:37 -0400
code

1 Answer

Hi, Before the OVER clause you have to set an analytic function. For example when I want to use the AVG function with an OVER clause, I usually follow this pattern: ``` AVG ( <expression> ) OVER ( [ <window order by clause> ] ):number ``` This example will return a number and it can be extrapolated to other analytic functions. For more information, check the section[ Analytic Functions (Window Functions)](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/analytic_functions_window_functions#analytic-functions-window-functions) of the Virtual DataPort VQL Guide. Hope this helps!
Denodo Team
04-07-2023 07:28:04 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here