2011-09-29 32 views
0

我使用數據庫查詢,如何檢查一個值不是空值和大於查詢中的其他值。如何檢查是不是空和大於在android的sqlite查詢

db.query(DB_TAB, new String[] { KEY_ROWID, stemp, dtemp },stemp + "!=" + null, null, null, null, null, null); 

我想檢查stemp和dtemp是否爲空,並且dtemp也是大於stemp。

+0

在創建數據庫期間,只有您可以定義不爲空的列,因此您不需要檢查它。 – Hanry

+0

看到這個答案http://stackoverflow.com/questions/11914860/sqlite-query-to-retrieve-all-rows-where-not-null-android –

回答

0

另外,不同的sqlite是「<>」不是「!=」。

+0

[「不等於運算符可以是!=或< >。「](http://www.sqlite.org/lang_expr.html) –

+0

你說得對。對不起:S –

相關問題