怎么把这3条语句合并成一条,我想用DataTable接受然后绑定到GridView。select t.logday as logday, sum(t.nodecount) as nodecount
from REP10000.ivr_node_log_10001 t
where t.nodeid in ('06', '032_JFDH')
and t.logday >= '20101126'
and t.logday <= '20101129'
group by t.logday
order by t.logday;
SELECT date_yyyymmdd,
sum(t2.N_Total_Inbound) callnum, --呼入数
sum(t2.N_Total_Answered) callednum, --应答数
round(sum(t2.N_Total_Answered) /
decode(sum(t2.N_Total_Inbound), 0, 1, sum(t2.N_Total_Inbound)),
3) * 100 calledrate, --接通率
round(sum(t2.N_total_answer_20) /
decode(sum(t2.N_Total_Inbound), 0, 1, sum(t2.N_Total_Inbound)),
3) * 100 called20rate --20秒及时应答率
FROM REP10000.view_telephone_amount_dulizh t2
WHERE t2.date_yyyymmdd >= '20101126'
and t2.date_yyyymmdd <= '20101129'
AND t2.skillid in ('18')
GROUP BY t2.date_yyyymmdd
order by t2.date_yyyymmdd;
select to_char(t.exchange_apply_time, 'yyyyMMdd') logday, --日期
count(*) jkqqnum, --请求数
round(avg(t.time_consume), 3) jkavgtime --平均耗时
from ivr_points_exchange_apply t
where to_char(t.exchange_apply_time, 'yyyyMMdd') >= '20101126'
and to_char(t.exchange_apply_time, 'yyyyMMdd') <= '20101129'
group by to_char(t.exchange_apply_time, 'yyyyMMdd')
order by to_char(t.exchange_apply_time, 'yyyyMMdd');
from REP10000.ivr_node_log_10001 t
where t.nodeid in ('06', '032_JFDH')
and t.logday >= '20101126'
and t.logday <= '20101129'
group by t.logday
order by t.logday;
SELECT date_yyyymmdd,
sum(t2.N_Total_Inbound) callnum, --呼入数
sum(t2.N_Total_Answered) callednum, --应答数
round(sum(t2.N_Total_Answered) /
decode(sum(t2.N_Total_Inbound), 0, 1, sum(t2.N_Total_Inbound)),
3) * 100 calledrate, --接通率
round(sum(t2.N_total_answer_20) /
decode(sum(t2.N_Total_Inbound), 0, 1, sum(t2.N_Total_Inbound)),
3) * 100 called20rate --20秒及时应答率
FROM REP10000.view_telephone_amount_dulizh t2
WHERE t2.date_yyyymmdd >= '20101126'
and t2.date_yyyymmdd <= '20101129'
AND t2.skillid in ('18')
GROUP BY t2.date_yyyymmdd
order by t2.date_yyyymmdd;
select to_char(t.exchange_apply_time, 'yyyyMMdd') logday, --日期
count(*) jkqqnum, --请求数
round(avg(t.time_consume), 3) jkavgtime --平均耗时
from ivr_points_exchange_apply t
where to_char(t.exchange_apply_time, 'yyyyMMdd') >= '20101126'
and to_char(t.exchange_apply_time, 'yyyyMMdd') <= '20101129'
group by to_char(t.exchange_apply_time, 'yyyyMMdd')
order by to_char(t.exchange_apply_time, 'yyyyMMdd');
如果结果字段是相同的,可以使用union查询;
如果不满足上面的情况,那就.....不知道了
可能把三个SQL分别放在三个DATATABLE中,然后在把三个DATATABLE绑定到GRIDVIEW中,这个没有亲自试过,楼主还要自己验证.
還是找出這個3個sql 表之間有什麼關聯
有的話就join 成一條sql
沒有關聯的話 就返回3張表
綁定給3個DataGrid
datatable合并
List<t>
可以用Cache,Sessionc叠加装入
再一起显示到控件上
datatable dt=new datatable();
datacoloum dc=new datacoloum();
datarow dr=dt.newrow();
进行循环 赋值 根据具体情况而定