I want to get a number of rows in my table using max(id). When it returns NULL - if there are no rows in the table - I want to return 0. And when t
max(id)
NULL
If you want to use the MAX(id) instead of the count, after reading the comments from Pax then the following SQL will give you what you want
SELECT COALESCE(MAX(id)+1, 0) FROM words