Skip to content Skip to sidebar Skip to footer

Android Sqlite Query Where Column Is Not Null And Not Empty

I cannot figure out the syntax for the .query call. I need to select all records that match a certain column that do not have a null or empty value for a second (different) column

Solution 1:

I believe the correct syntax would be:

ANDkeyISNOT NULL ANDkey != ""

where key is your column

Solution 2:

If multiple spaces can be in your column and you also want to treat them as empty values use TRIM

column_name ISNOTNULLANDTRIM(column_name," ") != ""

Post a Comment for "Android Sqlite Query Where Column Is Not Null And Not Empty"