[MONDRIAN-1572] Add the ability to use with clause with subqueries -
missed cleanup in sql generation causing bad sql.