How do I get the count of null value columns per row in a return set?

前端 未结 7 1731
臣服心动
臣服心动 2021-01-21 17:46

I\'m looking for a query which will return me an extra column at the end of my current query which is the count of all columns within the return set which contain a null column.

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 18:18

    If there isnt a very good reason you need to do this in the SQL, you should just do a for loop through the result set and count the NULL vlues then.

    The cost goes from n^n to n..

提交回复
热议问题