Closed masankin closed 5 years ago
sharding-sphere分库分表查询时碰到select count() from问题: Caused by: java.lang.IllegalStateException: Can't find index: AggregationSelectItem(type=COUNT, innerExpression=(), alias=Optional.absent(), derivedAggregationItems=[], index=-1), please add alias for aggregate selections
于是使用countQuery重写为 select count() as count 结果正常 考虑到 com.blinkfox.fenix.jpa.FenixJpaQuery.getCountSql 可替换 select count() SELECT_COUNT = "select count(*) as count from " 考虑看能否支持一下
@masankin 可以,今天或明天应该可以发一版出来。
@masankin 昨天改了默认求 count 时加 as 别名的功能,发了 v1.1.1版本,你试用下,没啥问题就关掉这个 issue 吧
count
as
v1.1.1
issue
sharding-sphere分库分表查询时碰到select count() from问题: Caused by: java.lang.IllegalStateException: Can't find index: AggregationSelectItem(type=COUNT, innerExpression=(), alias=Optional.absent(), derivedAggregationItems=[], index=-1), please add alias for aggregate selections
于是使用countQuery重写为 select count() as count 结果正常 考虑到 com.blinkfox.fenix.jpa.FenixJpaQuery.getCountSql 可替换 select count() SELECT_COUNT = "select count(*) as count from " 考虑看能否支持一下