iOS Swift: How to perform SQL SUM() function using MSQuery and NSPredicate?
问题 For example, I would like something similar to: select SUM[likes] from [MyAzureSQLService].[InstagramPost] where user == 'rain' Here, the "likes" is unsigned integer column in azure sql table "[MyAzureSQLService].[InstagramPost]", I wanted to query the sum number of all likes received by a specific user. My Swift code in iOS is like this: guard let table = client.table(withName: tableName) else { return } guard let query = MSQuery(table: table) else { return } query.predicate = NSPredicate