We have the following situation:
IRelationPredicateBucket filter = new RelationPredicateBucket();
IPredicate filterComponent = PredicateFactory.CompareRange(
ChildTableFieldIndex.Id, childIdList.ToArray());
filter.PredicateExpression.Add(filterComponent);
filter.Relations.Add(ChildTableEntity.Relations.MasterTableEntityUsingMaster_Id);
EntityCollection masterCollection = new EntityCollection (new MasterTableEntityFactory());
_adapter.FetchEntityCollection(masterCollection, filter);
fetch returns multiple identical rows from MasterTable:
SELECT Id, Value
FROM MasterTable
INNER JOIN ChildTable ON MasterTable.Id = ChildTable.Master_id
WHERE ChildTable.Id IN (9, 13, 10)) --(array of ChildTable.Id's)
We woluld like to know how to create the same sql statement, but with DISTINCT keyword!
SELECT DISTINCT Id, Value
FROM MasterTable
INNER JOIN ChildTable ON MasterTable.Id = ChildTable.Master_id
WHERE ChildTable.Id IN (9, 13, 10)) --(array of ChildTable.Id's)
Can this be done and how?