//条件删除
-(void)deleteStudentUnderAge:(NSInteger)age
{
NSString *deletesql = [NSString stringWithFormat:@"DELETE FROM 'student' WHERE age < %ld",age];
int result = sqlite3_exec(db,deletesql.UTF8String,NULL,NULL);
if (sqlITE_OK == result) {
NSLog(@"已经删除年龄在%ld下的",age);
}
else
{
NSLog(@"删除失败");
}
}
原文链接:https://www.f2er.com/sqlite/199300.html