select 交换机Id.小区名称,count(*)
from 交换机信息表 ,配线信息表 ,小区信息表
where 小区信息表.小区id=配线信息表.小区id
and 配线信息表.配线id=交换机信息表.配线id
group by 交换机Id.小区名称
from 交换机信息表 ,配线信息表 ,小区信息表
where 小区信息表.小区id=配线信息表.小区id
and 配线信息表.配线id=交换机信息表.配线id
group by 交换机Id.小区名称
解决方案 »
- ORA-12170: TNS:Connect timeout occurred错误怎么解决?谢谢!
- scott操作update dept和update scott.dept的区别
- Oracle数据库插入小数的问题
- oracle 怎么建立可信任连接
- 为何加优化注释在sql语句在单独执行可用,放在在存储过程中却不起作用?
- 关于oracle存储过程互相调用编译出错的问题。。
- 跪求各位大哥哥,大姐姐。安装问题。没答案也顶一下。高分啊。
- Oracle 9i的网络异常链接
- select * from table where time=SYS.time ? 对不对? 如何得到当天时间输入的记录?
- oracle密码到期,会导致sqluld2无法导出数据么?
- Oracel CD 清单,请大侠帮忙看看都是些什么东东?
- 怎么样拼一个sql语句并返回数据集?
DECLARE
i number(2);
tempi number(6);
CURSOR xiaoquid IS select distinct(小区ID) from l_小区信息表;
begin
select count(distinct(小区ID)) into i from l_小区信息表;
open xiaoquid;
<<label_>>
fetch xiaoquid into tempi;
select count(交换机ID) from l_交换机信息表 t where t.配线间id in(select 配线间id from l_配线间信息表 where 小区id=tempi);//报告该行缺少into语句
i:=i-1;
if i>0 then goto label_;
end if;
close xiaoquid;
end;
select
count(*) 交换机台数
from
table1 a,
table2 b,
table3 c
where
1=1
and a.小区名称='小区1'
and a.小区id=b.小区id
and b.配线id=c.配线id
建议发问题时能给出点样例数据,我上面写的不知道是不是你的需求可以实现的.