Reputation: 131
I have a float datatype column. I want the null values in that to be returned as blank when I select it. I tried this:
case when Column is null then '' else Column end
but it returns an error:
Invalid Syntax for float
Upvotes: 2
Views: 4564
Reputation: 31736
''
is a blank string and can't be implicitly cast to float
. You may either return NULL
or cast the output to text.
select case when Col is null then '' else Col::text end from t;
Upvotes: 1