実際のクエリ:-
SELECT *,COUNT(case when ZISREAD = 0 then ZISREAD end) FROM ZNOTIFICATION WHERE ZTTL>1411025900 group by zkind,zaction,zname
こんにちは、COUNT(case when ZISREAD = 0 then ZISREAD end)
コアデータを使用してカウント条件を変換する必要がありますNSExpression
NSExpression *countPathExpression = [NSExpression expressionForKeyPath: @"isRead"];
NSExpression *countExpression = [NSExpression expressionForFunction: @"count:"
arguments: [NSArray arrayWithObject:countPathExpression]];
NSExpressionDescription *countExpressionDescription = [[NSExpressionDescription alloc] init];
[countExpressionDescription setName: @"count"];
[countExpressionDescription setExpression: countExpression];
[countExpressionDescription setExpressionResultType: NSInteger32AttributeType];
私はみんなが変換するのを助ける必要がありCOUNT(case when ZISREAD = 0 then ZISREAD end)
ますNSExpression