---逆向思维即可。不存在不为0的,就是全部为0,语句如下if not exists(select 1 from table_name where column_name<>0) begin select '全部为0' ; endelse if exists(select 1 from table_name where column_name<>0) begin select '存在不为0' ; end