[dba-SQLServer] What gives with Null (or the lack thereof)

jwcolby jwcolby at colbyconsulting.com
Thu Jul 26 08:54:01 CDT 2012


I have two queries:

SELECT [EM_Email]
       ,[EM_EmailDomain]
   FROM [_DataEmail].[dbo].[tblEmail_Live]
   WHERE EM_EmailDomain is null
GO

Returns nothing.

SELECT     TOP (100) PERCENT COUNT(PK) AS Cnt, EM_EmailDomain
FROM         dbo.tblEmail_Live
GROUP BY EM_EmailDomain
ORDER BY Cnt DESC

returns null as the top most common EM_EmailDomain

Same table, same field, one query says I have lots of null values by count, the other query refuses 
to show them to me.

I'm confused.

-- 
John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it



More information about the dba-SQLServer mailing list