looking for some solutions? You are welcome.

SOLVED: Delete many columns with null


I have a table with 34 columns. First 4 columns form the primary key (thus they do not have nulls in them) and rest 30 columns have data in them also nulls. I wish to delete all the rows where rest 30 columns are null. A way would be -

delete from my_table
where column_30 is null
and columns_29 is null
and column_28 is null
and column_27 is null

Is there any easy way to do this without mentioning all 30 column names?

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: