#1841 - SqlServer findCount with @Aggregation gives SQLException:No column name was specified for column 2 of 'c'

This commit is contained in:
rob bygrave
2019-10-11 20:18:18 +13:00
parent b665d8375c
commit e00aa479ae
6 changed files with 29 additions and 32 deletions
@@ -52,6 +52,8 @@ public class TestAggregationTopLevel extends BaseTestCase {
if (isH2() || isPostgres()) {
assertThat(sql.get(0)).contains("select count(*) from ( select t0.date, sum(t0.total_kms) from d_machine_stats t0 group by t0.date having sum(t0.total_kms) > ?)");
assertThat(sql.get(1)).contains("select t0.date, sum(t0.total_kms) from d_machine_stats t0 group by t0.date having sum(t0.total_kms) > ? limit 10");
} else if (isSqlServer()) {
assertThat(sql.get(0)).contains("select count(*) from ( select t0.date c1, sum(t0.total_kms) c2 from d_machine_stats t0 group by t0.date having sum(t0.total_kms) > ?)");
}
}