Is there a quick way to check if ANY column is NULL?

后端 未结 4 1464
清歌不尽
清歌不尽 2020-12-06 17:15

I have a table with around 20 columns. Aside from typing out:

Where column1 is null OR column2 is null OR column3 is null etc...

Is there

4条回答
  •  隐瞒了意图╮
    2020-12-06 17:48

    You can find the column names using something like this:

    SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME =  
    

    Then, I would write a procedure using this, and that would loop through the entries in your table and the column names.

    Source: http://codesnippets.joyent.com/posts/show/337

提交回复
热议问题