Hello,
I have a case statement in a select statement and I want it to return null when the value is 0. For example -
case when capacity = '0' then '' else capacity end as 'capacity',
- still gives me a 0 in the results.
Hello,
I have a case statement in a select statement and I want it to return null when the value is 0. For example -
case when capacity = '0' then '' else capacity end as 'capacity',
case when capacity = 0 then null else capacity end as capacity
So easy Thank you!
or:
NULLIF(capacity, 0) AS capacity