本文主要是介绍nested exception is com.gbase.jdbc.exceptions.jdbc4.GBaseSyntaxErrorException: Mixing of GROUP colum,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
求MIN(),MAX(),COUNT(),…这几种函数时,需要根据某一个指标进行分组,需要在sql的最后加上 group by **…
异常源码:
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select region_code as nname, sum(CUSTOMER_NUM) as m from heyue_quanjiang where length(region_code) = ? and ddate = ? and CONTRACT_TYPE = ?]; nested exception is com.gbase.jdbc.exceptions.jdbc4.GBaseSyntaxErrorException: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseat org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:95)at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:605)at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:639)at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:668)at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:676)at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:716)at com.data.dao.BasicDataCalculationDao.getRatioTypeHeYueDescByKPI_SUM(BasicDataCalculationDao.java:1391)
这篇关于nested exception is com.gbase.jdbc.exceptions.jdbc4.GBaseSyntaxErrorException: Mixing of GROUP colum的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!