SQLite select where empty?

Timo Huovinen picture Timo Huovinen · Sep 1, 2010 · Viewed 133.6k times · Source

In SQLite, how can I select records where some_column is empty?
Empty counts as both NULL and "".

Answer

Guffa picture Guffa · Sep 1, 2010

There are several ways, like:

where some_column is null or some_column = ''

or

where ifnull(some_column, '') = ''

or

where coalesce(some_column, '') = ''

of

where ifnull(length(some_column), 0) = 0