Column aFilter = dbBeteiligte.getColumn("aFilter");
SelectStatement st = sqlFactory.newSelectStatement();
st.setTable(dbBeteiligte);
SelectTableReference ref = st.getSelectTableReference();
VirtualColumn num = new VirtualColumn("NUM", Column.Type.INTEGER);
num.setValue("COUNT(*) OVER (PARTITION BY " + aAktenId.getName() + ")");
st.addResultColumn(num);
VirtualColumn minAName = new VirtualColumn("MINANAME", Column.Type.VARCHAR);
minAName.setValue("MIN(UPPER(" + aName.getName() + ")) OVER (PARTITION BY " +
aAktenId.getName() + ")");
st.addResultColumn(minAName);
VirtualColumn minAVorname = new VirtualColumn("MINAVORNAME", Column.Type.VARCHAR);
minAVorname.setValue("MIN(UPPER(NVL(" + aVorname.getName() +
", ' '))) OVER (PARTITION BY " +
aAktenId.getName() + ", UPPER(" + aName.getName() +
"))");
st.addResultColumn(minAVorname);
st.addResultColumn(ref.newColumnReference(aName));