個々の結果が必要な場合は、次のクエリを使用できます。
select sum(if(locn_brcd between 'B2121' and 'B2144',1,0)) as ca1,
sum(if(locn_brcd between 'B2201' and 'B2224',1,0)) as ca2,
sum(if(locn_brcd between 'B2322' and 'B2344',1,0)) as ca3,
sum(if(locn_brcd between 'B2401' and 'B2424',1,0)) as ca4,
sum(if(locn_brcd between 'B2521' and 'B2544',1,0)) as ca5,
sum(if(locn_brcd between 'B2601' and 'B2624',1,0)) as ca6,
sum(if(locn_brcd between 'B0317' and 'B0340',1,0)) as ca7,
sum(if(locn_brcd between 'B0401' and 'B0424',1,0)) as ca8,
sum(if(locn_brcd between 'B0517' and 'B0540',1,0)) as ca9,
sum(if(locn_brcd between 'B0601' and 'B0624',1,0)) as ca10
from locn_hd;