当前位置:首页 > 数据库 > SQlite

java – 这是一个有效的SQLite查询

我有:

String sqlite = "SELECT count(_id) AS _lCount FROM answers WHERE phase = 3 and correct_incorrect='1'    

作为查询,但我需要correct_incorrect列也要考虑“1 *”

这是一个有效的方法来解释它吗?

String sqlite = "SELECT count(_id) AS _lCount FROM answers WHERE phase = 3 and correct_incorrect='1'or'1*'

我会测试它,但是“1 *”的可能性很少,需要几个小时的测试.所以我想确保我不只是浪费时间.

解决方法:

尝试使用IN

String sqlite = "SELECT count(_id) AS _lCount FROM answers WHERE phase = 3 and correct_incorrect IN ('1','1*')"

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!