Ejemplo n.º 1
0
 @Test
 public void test_两表join_orderby_groupby_limit条件() {
   TableNode table = new TableNode("TABLE1");
   JoinNode join = table.join("TABLE2", "ID", "ID");
   join.select(
       OptimizerUtils.createColumnFromString("TABLE1.ID AS JID"),
       OptimizerUtils.createColumnFromString("CONCAT(TABLE1.NAME,TABLE1.SCHOOL) AS JNAME"));
   join.orderBy("JID");
   join.groupBy("JNAME");
   join.having("COUNT(JID) > 0");
   IQueryTree qc = (IQueryTree) optimizer.optimizeAndAssignment(join, null, extraCmd);
   Assert.assertTrue(qc instanceof IMerge);
   Assert.assertEquals(QUERY_CONCURRENCY.CONCURRENT, ((IMerge) qc).getQueryConcurrency()); // 串行
 }