2 formatting
source | link

one way to get around this is to include the test in the whenwhen clause i.e. case when SUBSTRING(p.Name, 1, 1) = 'a' THEN '1' ... 

good coding

case
  when SUBSTRING(p.Name, 1, 1) = 'a' THEN '1'
...

one way to get around this is to include the test in the when clause i.e. case when SUBSTRING(p.Name, 1, 1) = 'a' THEN '1' ...

good coding

one way to get around this is to include the test in the when clause i.e. 

case
  when SUBSTRING(p.Name, 1, 1) = 'a' THEN '1'
...
1
source | link

one way to get around this is to include the test in the when clause i.e. case when SUBSTRING(p.Name, 1, 1) = 'a' THEN '1' ...

good coding