select 业务名称,sum(d.业务量),sum(d.业务费用)
from a,(select * from b,c where c.客户名称 = b.客户名称(+)) d
where d.行业名称 in (select 行业名称 from a where a.行业类型='电信');
from a,(select * from b,c where c.客户名称 = b.客户名称(+)) d
where d.行业名称 in (select 行业名称 from a where a.行业类型='电信');
where c.2 >= to_date('2000/1','yyyy/mm') and c.2 >= to_date('2002/1','yyyy/mm')
and c.1 in (select b.1 from a,b where a.2 = b.2 and a.1 = '行业类型')
SELECT c.业务名称 ,c.业务量,c.业务费用
FROM 表c c,表b b,表a a
WHERE c.用邮时间 >= "2000-01-01" and c.用邮时间 <= "2002-01-01"
AND a.行业类型 = "电信"
AND c.客户名称 = b.客户名称 AND b.行业名称 = a.行业名称
不用什么in之类的子查询,或者是嵌套查询,就可以把,只要把所有条件和表一
列即可???
where 客户名称 in (select b.客户名称 from 表a a,表b b where
a.行业类型='电信' and a.行业名称=b.行业名称 ) and c.用邮时间 between to_date('2000-1-1','yyyy-mm-dd') and to_date('2002-1-31','yyyy-mm-dd'))
from 表c c
group by c.业务名称