How do I use an SQL GROUP BY and SUM functions in a IOS CORE-DATA request in SWIFT?
问题 I have a table (Transactions) which holds records containing the Account_name and an Amount for the transaction. I would like to calculate the total for all transactions per account which start with 'Private' and for which the transaction amount is > 1000. I would like to get the accounts sorted by name, in a descending order. So the SQL request would be something like this : SELECT Account_name, SUM(Amount) FROM Transactions WHERE Account_name like 'Private%' and Amount > 1000 GROUP BY