17,092
社区成员
发帖
与我相关
我的任务
分享
select
liuzhe.liuzhe_cnt as 六折, bazhe.bazhe_cnt as 八折
from (select count(*) as liuzhe_cnt
from TF_B_FLOW_RESOURCE_ORDER t
where t.resource_code = '11120005102410006000'
and t.start_time >=
to_date('2015-06-18 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
and t.order_type = '00') liuzhe,
(select sum(decode(t.discount, '080', 1, 0)) as bazhe_cnt
from TF_B_FLOW_RESOURCE_ORDER t
where t.start_time >=
to_date('2015-06-18 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
and t.order_type = '00') bazhe
这个是我写的第一个的sql,现在还需要一个总量,麻烦大神在这个基础上帮我加一下怎么计算(liuzhe.liuzhe_cnt as 六折, bazhe.bazhe_cnt as 八折)这两个查询出来的总量,谢谢