The table MyTable contains 4 columns.
- id, phone columns are unique.
- id, phone, zipcode are never empty.
id - phone - salary - zipcode
1 - 61730459987 - $56052.45 - 02456
2 - 21249620709 - NULL - 10023
3 - 21200830859 - $39089.28 - 10023
...
10000 - 64600830857 - $46063.72 - 03795**
I need to remove NULLs by replacing them with salary_estimates, based on information from the same zip-codes.
As for the example above, NULL at row #2 could be replaced with $39089.28 (we can find from the table that another person with the same zip-code 10023 earns $39089.28, so it’s OK to update NULL for #2 with $39089.28).
So, after we run this query, the number of empty cells could be reduced (although not up to zero).
Could anybody suggest an update query for this problem?
1 Answer