Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For Discussion 


#

Comment
Owner
1Should Site Number & Name be unique ?
Alistair Pringle (Unlicensed)

Break down of SiteNumber and SiteName NULL or NOT NULL values;


Code Block
sql
sql
select CASE WHEN SiteName IS NULL THEN 'NULL' ELSE 'NOT NULL' END SiteName, 
	   CASE WHEN SiteNumber IS NULL THEN 'NULL' ELSE 'NOT NULL' END SiteNumber, status, count(*) 
from [HEELIVE].[vwSite] 
group by CASE WHEN SiteName IS NULL THEN 'NULL' ELSE 'NOT NULL' END, 
	   CASE WHEN SiteNumber IS NULL THEN 'NULL' ELSE 'NOT NULL' END, status


SiteNameSiteNumberstatusRowCount
NOT NULLNOT NULLCurrent7419
NOT NULLNULLCurrent817
NOT NULLNULLInactive243
NOT NULLNOT NULLInactive5265


Total13744


There are 12 SiteNames that have been duplicated, of which 5 have a Current Status;

...