add tag
Anonymous 857
I have a question about this fiddle:


Is it ever possible to get -1 as the result of this query? 
I think no, right because potato can be either null or not null and the case covers both scenario? 

sql server 11 

Top Answer
You are correct.

The CASE conditional expression can evaluate to either 1 or 0, never to a NULL.

The encapsulating ISNULL function will always see a concrete value, `1` or `0`, and so will never return `-1`.

If you explain what you are trying to achieve with this code that doesn't seem to work for you, we may be able to offer some advice.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.