我想按变量排序数据,然后选择第一条记录。但它不起作用。这是我的代码:
NSString *s = [db stringForQuery:@"SELECT cardInfo.?, cardInfo.?, cardInfo.? FROM cardInfo WHERE cardInfo.currentBalance > ? ORDER BY cardInfo.? DESC, cardInfo.? DESC, cardInfo.? ASC ", first, second, third, [NSNumber numberWithDouble:money], first, second, third];
如果我将其更改为按常量排序,它会起作用。
NSString *s = [db stringForQuery:@"SELECT a, b, c FROM cardInfo WHERE cardInfo.currentBalance > ? ORDER BY a DESC, b DESC, c ASC ",[NSNumber numberWithDouble:money]];
有谁知道如何纠正它?非常感谢。