sqlite查询相关问题
我有某些具有特定代码的 sqlite 数据。
String sql = "create table " + TABEL
+"( " + BaseColumns._ID+" integer PRIMARY KEY AUTOINCREMENT," + STARTTIME
+ " text," + ENDTIME + " text," + DURATION + " text,"
+ PHONEOPTION + " text," + MODE + " text);";
db.execSQL(sql);
Log.i("DATABASE ", "db created ");
我想获取持续时间列不包含空数据的行。 我有某些代码,但它获取其中的所有数据。
public Cursor getData() {
SQLiteDatabase sqlitedb = contactsdbHelper.getReadableDatabase();
Cursor cursor = sqlitedb.query(ContactsDatabaseHelper.TABEL, null,null,null, null,null, BaseColumns._ID + " DESC");
startManagingCursor(cursor);
return cursor;
}
I have certain sqlite data having the certain code.
String sql = "create table " + TABEL
+"( " + BaseColumns._ID+" integer PRIMARY KEY AUTOINCREMENT," + STARTTIME
+ " text," + ENDTIME + " text," + DURATION + " text,"
+ PHONEOPTION + " text," + MODE + " text);";
db.execSQL(sql);
Log.i("DATABASE ", "db created ");
and i want to fetch the rows where duration column having not null data.
i have certain code but it fetch the all data in it.
public Cursor getData() {
SQLiteDatabase sqlitedb = contactsdbHelper.getReadableDatabase();
Cursor cursor = sqlitedb.query(ContactsDatabaseHelper.TABEL, null,null,null, null,null, BaseColumns._ID + " DESC");
startManagingCursor(cursor);
return cursor;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试类似的方法:
Try something like: