PagerUtils support count(distinct)

This commit is contained in:
高铁
2016-01-26 11:40:51 +08:00
parent 8ede2f7b73
commit fbc537ef1d
2 changed files with 21 additions and 3 deletions
@@ -29,6 +29,13 @@ public class PagerUtilsTest_Count_MySql_0 extends TestCase {
Assert.assertEquals("SELECT COUNT(*)\n" + //
"FROM t", result);
}
public void test_mysql_3() throws Exception {
String sql = "select distinct id from t order by id";
String result = PagerUtils.count(sql, JdbcConstants.MYSQL);
Assert.assertEquals("SELECT COUNT(DISTINCT id)\n" + //
"FROM t", result);
}
public void test_mysql_group_0() throws Exception {
String sql = "select type, count(*) from t group by type";