I have values in registries that contain NaN values (they come from MATLAB). How would I convert them to NULL, or preferably, 0, in SQL?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have imported them into a SQL Server table
This converts the column values to NULL if they are the string ‘NaN’
For the column to contain ‘NaN’, it must be varchar, so if you prefer 0, that would be the string ‘0’
In a select statement, you can use either of