select count(*),t.分組欄位 from (
select t.* ,to_char(t.時間,'HH24') stime,to_char(t.時間,'HH24mi') fz,to_char(時間,'d')
from A t
where 時間>=to_date('2019-12-01','yyyy-MM-dd') and ghsj<=to_date('2019-12-31','yyyy-MM-dd') and to_char(時間,'d')='2'
) where stime in ('08','09','10','11','12') and fz>=0800 a
group by T.分組欄位
to_char(時間,'d') 取當前時間是星期幾 每星期第一天為周日
to_char(t.時間,'HH24mi') 取當前時間的小時分
o_char(t.時間,'HH24') 取當前時間的小時
————————————————
著作權宣告:本文為CSDN博主「陳小妖」的原創文章,遵循 CC 4.0 BY-SA 著作權協議,轉載請附上原文出處鏈接及本宣告,
原文鏈接:https://blog.csdn.net/chenxiaojie_26/article/details/103823260
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/21735.html
標籤:Oracle
