select
sum(case when age>30 and salary>9000 then 1 else 0 end) [team1],
sum(case when age>30 and salary<9000 then 1 else 0 end) [team2],
sum(case when age<30 and salary>9000 then 1 else 0 end) [team3],
sum(case when age<30 and salary<9000 then 1 else 0 end) [team4]
from 表名
select count(*) from 员工 where age>30 and salary>9000 or age>30 and salary<9000 or age<30 and salary>9000 or age<30 and salary<9000