?? sql2.txt
字號:
select t1.category,t1.count1,t2.count2,t3.count3
from (
select business.category,count(information.information_id) as count1
from business left join information
on business.business_id=information.business_id
and information.is_pub=1
and information.reg_date between TO_DATE('1900-11-21','YYYY-MM-DD HH24:MI:SS')
and TO_DATE('2900-11-21','YYYY-MM-DD HH24:MI:SS')
group by business.category
) t1,
( select business.category,count(information.information_id) as count2
from business left join information
on business.business_id=information.business_id
and information.is_pub=0
and information.reg_date between TO_DATE('1900-11-21','YYYY-MM-DD HH24:MI:SS')
and TO_DATE('2900-11-21','YYYY-MM-DD HH24:MI:SS')
group by business.category
) t2,
( select business.category,decode(sum(information.pay_count),null,0,sum(information.pay_count)) as count3
from business left join information
on business.business_id=information.business_id
and information.reg_date between TO_DATE('1900-11-21','YYYY-MM-DD HH24:MI:SS')
and TO_DATE('2900-11-21','YYYY-MM-DD HH24:MI:SS')
group by business.category
) t3
where t1.category=t2.category
and t1.category=t3.category
order by category
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -