Syntax error in SQL statement - H2 error 42001

After running this SQL statement:

select TimeInterval, ((((Timer*60)/1.0)*100)/((10.0*60)/60.0)) as 'Throughput-run_1_8_11' from StatExternalData, StatisticDefinition where StatisticDefinition.ID=StatExternalData.StatDefId and StatisticName='PSI_CompTran_Successful_Cnt' order by TimeInterval asc 

I get this error:

 "select TimeInterval, ((((Timer*60)/1.0)*100)/((10.0*60)/60.0)) as 'Throughput-run_1_8_11'[*] from StatExternalData, StatisticDefinition where StatisticDefinition.ID=StatExternalData.StatDefId and StatisticName='PSI_CompTran_Successful_Cnt' order by TimeInterval asc"; expected "identifier"; [42001-185] 

I realized that [*] indicates which part of the statement is incorrect and that error code 42001 H2 means an invalid SQL statement, but I banged my head on the wall for several weeks, what problem does anyone have an idea?

+6
source share
1 answer

I had the same problem:

My essence looked like this:

 @Entity public class ShopCommentRating { @NotNull private Boolean like; } 

The request contained [*]

To remove the error, I had to change the field name to sth. eg:

 @Entity public class ShopCommentRating { @NotNull private Boolean commentLike; } 

"lower case camel case"

0
source

Source: https://habr.com/ru/post/985077/


All Articles