oracle 查詢當天、當月、當年範圍的記錄

當天:Select * From GG_DTXX a Where trunc(fbsj)= trunc(Sysdate)
當月:Select * From GG_DTXX a Where to_char(fbsj,'yyyymm') = to_char(Sysdate,'yyyymm')
當年:select * from GG_DTXX  t  where t.fbsj >=trunc(sysdate,'YYYY') and t.fbsj<=add_months(trunc(sysdate,'YYYY'),12)-1
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章