开发者

Objective C: CoreData and aggregation

开发者 https://www.devze.com 2023-01-03 13:29 出处:网络
Given a CoreData-Entity with an date (days) and an ammount called Transaction. Is it with CoreData possible (and how) to aggregate/group the \'table\' (with all Transactions) by Date and calculate the

Given a CoreData-Entity with an date (days) and an ammount called Transaction. Is it with CoreData possible (and how) to aggregate/group the 'table' (with all Transactions) by Date and calculate the sum of the day in a second column/attribute? (the SQL-Solution would be SELE开发者_如何学运维CT date, sum(ammount) FROM transaction GROUP BY date)


They may not do exactly what you want, but since Core Data is fully KVC compliant, take a look at the Key-Value Coding Set and Array operators. This should at least get you pretty close to what you're looking to do.


Stack Overflow: "CoreData equivalent of sum…group by"

0

精彩评论

暂无评论...
验证码 换一张
取 消