NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"People" inManagedObjectContext:managedObjectContext];
request.entity = entity;
request.propertiesToFetch = [NSArray arrayWithObject:[[entity propertiesByName] objectForKey:@"age"]];
request.returnsDistinctResults = YES;
request.resultType = NSDictionaryResultType;//必须,如果没有这一句,上边限定不重复的语句就被忽略
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"age" ascending:YES];
[request setSortDescriptors:[NSArray arrayWithObject:sortDescriptors]];
[sortDescriptor release];
NSError *error = nil;
NSArray *distincResults = [managedObjectContext executeFetchRequest:request error:&error];
// Use the results
[request release];
源: http://felipecypriano.com/2011/09/21/core-data-how-to-do-a-select-distinct/