SELECT a.*
FROM CBOSS.CALL_BACK_CRM T, cboss.i_user_radius_index_his a
WHERE t.phone_id = a.bill_id
and t.so_nbr = a.so_nbr
and a.act_type = '06'
and t.busi_type = 53
and result_code not in ('0', '00','1-00', '1-0000', '2-00', '2-0000')
and t.create_date >=
to_date('2012-04-15 01:00:00', 'yyyy-mm-dd hh24:mi:ss')
and t.create_date <=
to_date('2012-05-15 01:00:00', 'yyyy-mm-dd hh24:mi:ss')
call_back_CRM 表每天有几千万的数据量,不知道多表连接查询好,还是查询单表后再查询另一个单表效率好,,,
数据库是oralce 数据库
FROM CBOSS.CALL_BACK_CRM T, cboss.i_user_radius_index_his a
WHERE t.phone_id = a.bill_id
and t.so_nbr = a.so_nbr
and a.act_type = '06'
and t.busi_type = 53
and result_code not in ('0', '00','1-00', '1-0000', '2-00', '2-0000')
and t.create_date >=
to_date('2012-04-15 01:00:00', 'yyyy-mm-dd hh24:mi:ss')
and t.create_date <=
to_date('2012-05-15 01:00:00', 'yyyy-mm-dd hh24:mi:ss')
call_back_CRM 表每天有几千万的数据量,不知道多表连接查询好,还是查询单表后再查询另一个单表效率好,,,
数据库是oralce 数据库
call_back_CRM 表每天有几千万的数据量,
这些数量一进来就拿去用还是搁在库里?
如果是一进来就用建议用子查询
版主大大 我没有表述清楚。
连接查询是 call_back_crm跟i_user_radius_index表连接然后union all连接
call_back_crm和i_user_radius_index_his表
总共连接6次(call_back_crm表 call_back_crm_his call_back_crm_his_YYYYMM )
最后把数据查出来我想的单表查询是
查询call_back_crm 表还要查call_back_crm_his call_back_crm_his_YYYYMM等最近两个月的分表,如果用单表查询,需要把这些表都查询一边,查出来so_nbr然后查询 i_user_radius_index 表和i_user_radius_index_his表,
现在想想这会有问题的,查出来so_nbr 然后根据每个so_nbr 去i_user_radius_index表中查数据,程序中这样循环扫表每次只查出来一条这样根本不行,,