select '0-3' salfrom
(
select 分公司编号,
部门编号,姓名 ,sum(10000) as sal
from
table_1
where to_char(发放月份,'yyyy') = '2011'
group by 分公司编号,
部门编号,姓名
union all
select '0-3' salfrom
(
select 分公司编号,
部门编号,姓名 ,sum(10000) as sal
from
table_1
where to_char(发放月份,'yyyy') = '2011'
group by 分公司编号,
部门编号,姓名
) where sal >= 30000 and sal '30000' and sum(t2.salary)'50000' and sum(t2.salary)<'100000') |