Android sqlite - select records where field is null or empty
db.rawQuery("SELECT * FROM myTable WHERE myColumn IS NULL", null);
I am using android studio 3.4, Room 2.1.0-alpha07
This is my Kotlin Code
I tried using this didn't work as expected
`@Query("SELECT *FROM notifications WHERE status=:status OR status = null")`
This one is working fine
@Query("SELECT *FROM notifications WHERE status=:status OR status is null")
Just use "folder_name is null"
Try
cursor = db.query(DBHelper.TABLE_NAME, COLUMNS, "folder_name is null or folder_name = ?", new String[] {""}, null, null, DBHelper.TIMESTAMP_COL + " DESC");