Update all SQL NULL values in multiple columns using Column level WHERE clause?

前端 未结 4 1860
花落未央
花落未央 2021-01-02 18:31

We have a database with a bunch of wide tables (40-80 columns each) and just found a bug that introduced NULL values into about 500 of the records. The NULL values can appea

4条回答
  •  攒了一身酷
    2021-01-02 19:27

    I don't like the idea to manipulate the data itself for the purpose of reporting. If you change the NULL values to 99 to just to make your reporting easier then the I consider that data as corrupted. What if there are other consumer apart from reporting which need genuine data?

    I would rather write an intelligent query for the report. For example, if you use ISNULL(columnname, 99), it would return 99 whenever the column value is NULL.

提交回复
热议问题