实际查询:-
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