1. 程式人生 > >在Oracle中查詢Date型別欄位的資料

在Oracle中查詢Date型別欄位的資料

利用函式:to_char和to_date

select * from  [表名] where to_char([需要查詢的欄位],'yyyyMMdd') between '20130601' and '20130630'

select * from  [表名] where [需要查詢的欄位] between to_date('20130601', 'yyyy-mm-dd hh24:mi') and to_date('20130630', 'yyyy-mm-dd hh24:mi')