sql server 2008 - How to count for records with empty values in 3 colums -
I'm not a SQL Server 2008 expert, but that's what I'm trying to do. Let's say I have this table: I have to calculate those records which do not have values in col2, col3 , and col4 , Code> col1 = 1 , I've tried to do this: from the SELECT COUNT (col1) table where len (col2) & gt; 1 or LAN (col 3) & gt; 1 or lennon (col4)> 1 and col1 = '1' But I get thousands of records. If any of you can help me or point me in the right direction, then I appreciate it. Thank you. SELECT COUNT (col1) = "text"> operator preference Check it at 'and' before it is evaluated 'or' your example looks like: where to take from the SELECT COUNT (col1) table (col2) & gt; 1 or LAN (col 3) & gt; Such records should be counted that you do not have the value But if your code is counting the records that do the values, then you might want it: SELECT COUNT (col1) table. You can show data in which Va...