Кхм...попробовал, у меня на трешке не выдает дублей никаких, и даже без changed()
X++:
qbDSItem = query.addDataSource(tableNum(InventTable));
qbDSItem.addSortField(fieldNum(InventTable, ItemId));
qbDSItem.orderMode(OrderMode::GroupBy);
qbDSItem.addSelectionField(fieldNum(InventTable, ItemId));
//добавляю таблицу InventTrans
qbDS = qbDSItem.addDataSource(tableNum(InventTrans));
qbDS.joinMode(JoinMode::OuterJoin);
qbDS.addLink(fieldNum(InventTable, ItemId), fieldNum(InventTrans, ItemId));
qbDS.addSortField(fieldNum(InventTrans, ItemId));
qbDS.orderMode(OrderMode::GroupBy);
//вывожу результат
queryRun = new QueryRun(query);
while (queryRun.next())
{
inventTable = queryRun.get(tableNum(InventTable));
inventTrans = queryRun.get(tableNum(InventTrans));
//if (queryRun.changed(tablenum(InventTable)))
info( strfmt( "%1 %2", inventTable.ItemId, inventTrans.ItemId));
}
добавил qbDS.orderMode(OrderMode::GroupBy);