Sql-server – Find a row with value zero in any column

sql serversql-server-2016

I’ve 10,000 rows with 64 columns.

If any column in any row has the value “0”, that row needs to be selected. Does anyone have a ready-made query? It would be a benefit to my project.

The values can be null. The value cannot be negative. It is an int value. The version is SQL Server 2016.

Best Answer

Too many variants:

WHERE column1=0 OR column2=0 OR ... OR column64=0
WHERE column1*column2* ... *column64=0
WHERE 0 IN (column1, column2, ... column64)

and so on...