I have this SQL:
update entity_table set views = views + 1 where id = {id of entity}
The view column is NULL. Thus, this only works if the column has a value that is not null.
How can I make this statement set to 1 if it is null and increment otherwise?
Thanks.
sql-server sql-server-2008
Richard
source share