#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:26:35 +13:00
parent e00aa479ae
commit 4807070147
@@ -53,7 +53,7 @@ public class TestAggregationTopLevel extends BaseTestCase {
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) > ?)");
assertThat(sql.get(0)).contains("select count(*) from ( select t0.date c0, sum(t0.total_kms) c1 from d_machine_stats t0 group by t0.date having sum(t0.total_kms) > ?) as c");
}
}