public void testSelectAlias() throws Exception {
Query q = MetaModelHelper.parseQuery(dc, "SELECT foo AS f FROM sch.tbl");
assertEquals("SELECT tbl.foo AS f FROM sch.tbl", q.toSql());
q = MetaModelHelper.parseQuery(dc, "SELECT a.foo AS foobarbaz FROM sch.tbl a WHERE foobarbaz = '123'");
assertEquals("SELECT a.foo AS foobarbaz FROM sch.tbl a WHERE foobarbaz = '123'", q.toSql());
}
public void testSelectDistinct() throws Exception {
Query q = MetaModelHelper.parseQuery(dc, "SELECT DISTINCT foo, bar AS f FROM sch.tbl");
assertEquals("SELECT DISTINCT tbl.foo, tbl.bar AS f FROM sch.tbl", q.toSql());