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
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.