q1.setSelect(s1);
q1.setFrom(f1);
Select s2 = new Select();
s2.addSymbol(new ElementSymbol("e1")); //$NON-NLS-1$
s2.addSymbol(new ExpressionSymbol("blargh", new ScalarSubquery(q1))); //$NON-NLS-1$
From f2 = new From();
f2.addGroup(new GroupSymbol("m.g2")); //$NON-NLS-1$
Criteria left = new SubqueryCompareCriteria(new ElementSymbol("e3"), q1, SubqueryCompareCriteria.GE, SubqueryCompareCriteria.ANY); //$NON-NLS-1$
Criteria right = new ExistsCriteria(q1);
Criteria outer = new CompoundCriteria(CompoundCriteria.AND, left, right);