In SQLite, how can I select records where some_column is empty?
Empty counts as both NULL and \"\".
You can do this with the following:
int counter = 0;
String sql = "SELECT projectName,Owner " + "FROM Project WHERE Owner= ?";
PreparedStatement prep = conn.prepareStatement(sql);
prep.setString(1, "");
ResultSet rs = prep.executeQuery();
while (rs.next()) {
counter++;
}
System.out.println(counter);
This will give you the no of rows where the column value is null or blank.