oracle存盤程序,查詢每個月的記錄量:如果當月沒有則當月為0,回傳是12個月的資料list,
大佬們,有沒有會寫的?
我之前用的mysql
select(
(select count(0) from xxxx ....) as "1月",
(select count(0) from xxxx ....) as "2月",
(select count(0) from xxxx ....) as "3月",
。。。
)
但是oracle中不能這樣寫,求大佬,急求
----------------------------
找到一個很簡單的方法,但是沒有資料的月份就沒有月份和資料
select to_char(created_time,'MM') mon,count(*) num from mp_component_info t
where to_char(created_time,'yyyy')='2018'
group by to_char(created_time,'MM')
order by mon
求大佬。。。。。。
uj5u.com熱心網友回復:
select level from dual connect by level <= 12 外鏈接轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/34712.html
標籤:基礎和管理
下一篇:orcal怎么創建特定的序列號
