我創建了一個表中的SQLite鉻(HTML5):如何獲得所有列在sqlite中大於零的結果?
transaction.executeSql(
'CREATE TABLE IF NOT EXISTS record('+
'id INTEGER NOT NULL PRIMARY KEY,'+
'fkindicatorspeciesid INTEGER NOT NULL REFERENCES indicatorspecies(indicatorspeciesid),'+
'latitude INTEGER NOT NULL,'+
'longitude INTEGER NOT NULL,'+
'time TEXT NOT NULL,'+
'`when` TEXT NOT NULL,'+
'numberseen INTEGER NOT NULL,'+
'notes TEXT NOT NULL,'+
'online_recordid INTEGER,'+
'status TEXT,'+
'locationid INTEGER REFERENCES location(locationid),'+
'surveyid INTEGER REFERENCES survey(id));',
[], nullHandler,errorHandler);
然後我一些數據添加到它:
現在我嘗試檢索所有的記錄,其中「online_recordid」較大則零:
select * from record where online_recordid > 0;
我不應該讓我的紀錄回來,因爲沒有什麼在列「online_recordid」。問題是我確實拿回了唱片!
我試過你的線路,但得到的記錄沒有任何online_recordid。我認爲這可能是由cyberkiwi解釋的事情發生的。 – Timo 2011-02-11 01:17:17