title: SQLite - getting number of rows in a database
body: <p>I want to get a number of rows in my table using <code>max(id)</code>. When it returns <code>NULL</code> - if there are no rows in the table - I want to return 0. And when there are rows I want to return <code>max(id) + 1</code>.</p>
  
  <p>My rows are being numbered from 0 and autoincreased.</p>
  
  <p>Here is my statement:</p>
  
  <pre><code>SELECT CASE WHEN MAX(id) != NULL THEN (MAX(id) + 1) ELSE 0 END FROM words
  </code></pre>
  
  <p>But it is always returning me 0. What have I done wrong?</p>