SQLite的查询检查 - 小于和大于 [英] Sqlite query check - less than and greater than
本文介绍了SQLite的查询检查 - 小于和大于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
返回mDb.query(DATABASE_TABLE,新的String [] {KEY_ROWID,
KEY_LEVEL},KEY_LEVEL +>中+=+ 3 +&下; + 5,NULL,NULL,NULL,NULL);
我是什么做错了。它的返回遍以上,且等于3级,但不能少于5个。我试过和放大器;&安培; |和这样的。
解决方案
KEY_LEVEL +>中+=+ 3 +&下; + 5
翻译为
KEY_LEVEL +> = 3'; 5
使用,而不是:
KEY_LEVEL +> = 3,+ KEY_LEVEL +小于5
return mDb.query(DATABASE_TABLE, new String[] { KEY_ROWID,
KEY_LEVEL }, KEY_LEVEL + ">" + "=" + 3 + "<" + 5, null, null, null, null);
What am I doing wrong. It's returning all over above and equal to level 3 but not less than 5. I've tried && | and such.
解决方案
KEY_LEVEL + ">" + "=" + 3 + "<" + 5
translates as
KEY_LEVEL + ">=3<5"
Use that instead:
KEY_LEVEL + ">= 3 AND " + KEY_LEVEL + " < 5"
这篇关于SQLite的查询检查 - 小于和大于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文