首页 > 代码库 > ax没有distinct ,只能projId进行group by

ax没有distinct ,只能projId进行group by


Query query =new Query();
SysTableLookup lookup;
QueryBuil dDataSource ds;
TableId table=tableNum(InventTrans);
FieldId field=fieldNum(InventTrans,projId);
;
lookup=SysTableLookup::newParameters(table,this);
ds=query.addDataSource(table);
ds.orderMode(OrderMode::GroupBy);
ds.addSelectionField(field,SelectionField::Database);
ds.addSortField(field);
// 等价于 select projId from inventTrans group by projId
lookup.parmQuery(query);
lookup.addLookupfield(field);
lookup.performFormLookup();