Answer the question
In order to leave comments, you need to log in
How to convert empty string to 0 in postgres?
The request has a piece cast(X as float)
Sometimes X can be an empty string, then it crashes with an error. What to use to convert '' to 0?
Answer the question
In order to leave comments, you need to log in
The construct COALESCE(NULLIF(X, ''), 0)
will return 0 if X is NULL or an empty string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question