We have an existing table with no relationships.
Take a look at "Removing Duplicated Objects" in the help, this might do what you need
http://www.tmssoftware.com/business/aurelius/doc/web/index.html?removing_duplicated_objects.htm
Robert:
Did you ever work out how to do a "SELECT DISTINCT" for a single field with Aurelius? I've tested with .RemovingDuplicatedObjects, but if more than one object/row has the same field value (email in your example), then multiple objects are still returned, presumably since other fields are unique.
My current query is:
var
Results:TObjectList<TCriteriaResult>;
...
Results := ObjManager.Find<TContact>
.Select(Linq['EMail'])
.OrderBy('EMail')
.RemovingDuplicatedEntities
.ListValues;
Greg
RemovingDuplicatedEntities
only work for entities, not projected values.
One workaround is to use SQL projection:
var
Results:TObjectList<TCriteriaResult>;
...
Results := ObjManager.Find<TContact>
.Select(Linq['EMail'])
.Select((TProjections.Sql<string>('Distinct {Email}').As_('EMail'))
.OrderBy('EMail')
.ListValues;
Thank you, Wagner. This works well.
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.