new SQLSubQuery().union(q1);
}
@Test
public void Union_With() {
QSurvey survey1 = new QSurvey("survey1");
QSurvey survey2 = new QSurvey("survey2");
QSurvey survey3 = new QSurvey("survey3");
SQLQuery query = new SQLQuery(SQLTemplates.DEFAULT);
query.with(survey1, new SQLSubQuery().from(survey1).list(survey1.all()));
query.union(
new SQLSubQuery().from(survey2).list(survey2.all()),
new SQLSubQuery().from(survey3).list(survey3.all()));
assertEquals("with survey1 as (select survey1.NAME, survey1.NAME2, survey1.ID\n" +
"from SURVEY survey1)\n" +
"(select survey2.NAME, survey2.NAME2, survey2.ID\n" +
"from SURVEY survey2)\n" +