SQL 语句中的语法错误 - H2 错误 42001

新手上路,请多包涵

运行此 SQL 语句后:

 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

我收到此错误:

 "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]

我发现 [*] 表示语句的哪一部分不正确,而 H2 错误代码 42001 表示无效的 SQL 语句,但我已经数周来一直在努力想弄清楚是什么问题是,有人有想法吗?

原文由 SnoBro 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 2.1k
1 个回答

我通过重命名我的实体解决了这种错误代码。看来,某些名称被解释为查询命令-.-

原文由 Nils Teipel 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
Stack Overflow 翻译
子站问答
访问
宣传栏