do a coalesce on blanks instead of nulls as the db is populated with blanks

This commit is contained in:
Paul Trowbridge 2025-10-21 10:06:15 -04:00
parent 66779efb0a
commit 6101bf4ddf
4 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ BEGIN
CASE SUBSTRING(bc.cclass, 2, 3)
WHEN 'DIS' THEN
CASE SUBSTRING(sc.cclass, 2, 3)
WHEN 'DIS' THEN COALESCE(sc.plevel,bc.plevel)
WHEN 'DIS' THEN CASE WHEN COALESCE(sc.plevel,'') = '' THEN bc.plevel ELSE sc.plevel END
ELSE bc.plevel
END
ELSE bc.plevel

View File

@ -182,7 +182,7 @@ BEGIN
CASE SUBSTRING(bc.cclass, 2, 3)
WHEN 'DIS' THEN
CASE SUBSTRING(sc.cclass, 2, 3)
WHEN 'DIS' THEN COALESCE(sc.plevel,bc.plevel)
WHEN 'DIS' THEN CASE WHEN COALESCE(sc.plevel,'') = '' THEN bc.plevel ELSE sc.plevel END
ELSE bc.plevel
END
ELSE bc.plevel

View File

@ -184,7 +184,7 @@ BEGIN
CASE SUBSTRING(bc.cclass, 2, 3)
WHEN 'DIS' THEN
CASE SUBSTRING(sc.cclass, 2, 3)
WHEN 'DIS' THEN COALESCE(sc.plevel,bc.plevel)
WHEN 'DIS' THEN CASE WHEN COALESCE(sc.plevel,'') = '' THEN bc.plevel ELSE sc.plevel END
ELSE bc.plevel
END
ELSE bc.plevel

View File

@ -78,7 +78,7 @@ BEGIN
CASE SUBSTRING(bc.cclass, 2, 3)
WHEN 'DIS' THEN
CASE SUBSTRING(sc.cclass, 2, 3)
WHEN 'DIS' THEN COALESCE(sc.plevel,bc.plevel)
WHEN 'DIS' THEN CASE WHEN COALESCE(sc.plevel,'') = '' THEN bc.plevel ELSE sc.plevel END
ELSE bc.plevel
END
ELSE bc.plevel