android - 如何在 SQLite WHERE 子句中包含 bool 值

标签 android sqlite

我没有得到任何结果。如何在 SQLite 的 where 子句中包含 bool 条件?

这些我都试过了

"Select * from table where col = 1"
"Select * from table where col = '1'"
"Select * from table where col = true"
"Select * from table where col = 'true'"
"Select * from table where col = 'True'"
"Select * from table where col is True"

没有。我什至尝试将“true”作为查询函数中的 whereArgs。

我该如何解决?

最佳答案

SQLite does not have a separate Boolean storage class. Instead, Boolean values are stored as integers 0 (false) and 1 (true).

来源:SQLite

第一个听起来是正确的。

关于android - 如何在 SQLite WHERE 子句中包含 bool 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4824687/

相关文章:

android - onNewIntent() 在 onResume() 中被多次调用

android - For 循环导致应用程序可能在其主线程上做太多工作

android - 您可以从现有应用的 APK 中删除 Android signing v1 吗?

java - Android - sqlite in 子句使用数组列表中的字符串值?

android - 什么会运行 ExampleUnitTest 但找不到 ExampleInstrumentedTest?

android - Android 2.0 添加联系人号码

python - 仅选择日期和年份 SQLite

sql - 联合查询 SQL 使用相同的别名

java - java中无法从另一个类访问一个类

sqlite - SQlite与Windows 8 Metro应用程序