I’m cleaning a weather dataset in Google BigQuery where missing values in wind_speed and visibility were incorrectly stored as 0.
I tried updating the table like this:
UPDATE `my_project.weather_data.tracks_2023`
SET
wind_speed = CASE WHEN wind_speed = 0 THEN NULL END,
visibility = CASE WHEN visibility = 0 THEN NULL END
WHERE wind_speed = 0 OR visibility = 0;
The query returns an error.
My goal is simple:
- Convert
0values inwind_speedtoNULL - Convert
0values invisibilitytoNULL - Leave all other values unchanged
What’s the correct way to do this in BigQuery?
