有3表
表a
表b
表c
通过表a知道表b的值,通过表b知道表c的值
a
number
serv_id
b
serv_id
exch_id
nwk_id
c
nwk_id
describ输入number->通过a得到serv_id->通过serv_id查表b->得到nwk_id->nwk_id在C表中不止一条
我想得到的结果是
a.number,b.exch,c中的此number对应的nwk_id的条数比如单条数据
1234567(number)->321(serv_id),334(exch_id)->678(nwk_id)
然后我count下C表中nwk_id等于678的条数是2
结果是
1234567,334,2
现在我有100多万数据....求助.谢谢
表a
表b
表c
通过表a知道表b的值,通过表b知道表c的值
a
number
serv_id
b
serv_id
exch_id
nwk_id
c
nwk_id
describ输入number->通过a得到serv_id->通过serv_id查表b->得到nwk_id->nwk_id在C表中不止一条
我想得到的结果是
a.number,b.exch,c中的此number对应的nwk_id的条数比如单条数据
1234567(number)->321(serv_id),334(exch_id)->678(nwk_id)
然后我count下C表中nwk_id等于678的条数是2
结果是
1234567,334,2
现在我有100多万数据....求助.谢谢
解决方案 »
- 增大的根源在哪?
- 大哥们 能不能介绍本oracle的书 看看
- pl/sql function的语法
- 更改了控制文件参数后,数据库就无法打开了
- 成都招聘程序员(紧急)
- 怎样用SQL语句指定使用哪个方案?
- oracle数据乱码怎么办
- 用过oracle8.05的朋友们请帮忙呀,Instance manager怎么设置最大连接用户数
- 现在有一个收入记录表,每条记录为某个月的某个项目的收入,我想选出某个月中,收入比上月下滑的项目(统计出项目名称,这个月收入,上个
- 谁能帮我到metalink上查查?! PRKP-1007 谁能解答?!
- 关于long型的问题,请大家帮忙!!!!!!
- oracle启动服务程序的问题
from a inner join b
on a.serv_id=b.serv_id
inner join c
on b.nwk_id=c.nwk_id
group by a.number,b.exch_id--这样行不
from a ,b, c
where a.serv_id=b.serv_id
and b.nwk_id=c.nwk_id
group by a.number,b.exch_id
b.exch_id,
count(1)
from a ,
inner join b
inner join c on
a.serv_id = b.serv_id
and b.nwk_id = c.nwk_id
group by a.number ,
b.exch_id
数据量太大,不行.
======================================================================
你的表结构为:
a(number , serv_id)
b( serv_id, exch_id, nwk_id)
c( nwk_id, describ)
======================================================================
操作语句为:
select a.numbers,b.exch_id,count(*)
from a ,b , c
where a.serv_id=b.serv_id
and b.nwk_id=c.nwk_id
group by a.numbers,b.exch_id
======================================================================
a表=b表的数据量,200W,
数据量太大,不行.
select a.number,b.exch_id,count(*)
from a inner join b
on a.serv_id=b.serv_id
inner join c
on b.nwk_id=c.nwk_id
group by a.number,b.exch_id
---
是结果不对
还是速读慢
如果是速度问题,加些索引阿