select sum(case name when '早晨' then 1 else 0 end) as morning,
sum(case name when '中午' then 1 else 0 end) as noon,
sum(case name when '晚上' then 1 else 0 end) as evening
from t
case name when 'a' then 1 else 0 end
has counterpart in Oracle as
decode(name, 'a', 1, 0)