如何将sql查询转换为谓词或获取请求,
select a.name from a group by a.name;
答案 0 :(得分:1)
这是一个可能的解决方案:
NSFetchRequest* request = [NSFetchRequest fetchRequestWithEntityName:@"a"];
[request setPropertiesToFetch:@[@"name"]];
[request setPropertiesToGroupBy:@[@"name"]];
[request setResultType:NSDictionaryResultType];