return sel;
}
// now set sql criteria; it goes on the inner select if present
if (inner != null)
inner.where(where);
else
sel.where(where);
// apply grouping and having. this does not select the grouping
// columns, just builds the GROUP BY clauses. we don't build the