sql時間比較


date類型

select * from t_base_employee t where t.modify_time>to_date('2018-06-28 00:00:00','yyyy-mm-dd hh24:mi:ss') and t.modify_time<to_date('2018-06-29 12:00:00','yyyy-mm-dd hh24:mi:ss');

char類型

select * from Hr_Emp_Org_v t where t.C_OPERATE_TIME>'2018-06-28 00:00:00' and t.C_OPERATE_TIME<'2018-06-29 12:00:00' and t.C_EMPLOYEE_STATUS='在職'

timestamp類型

select *
  from Tb_Sta_Emp t
 where t.C_OPERATE_TIME >
       to_timestamp('2018-06-28 00:00:0.000000000',
                    
                    'yyyy-mm-dd hh24:mi:ss.ff9');

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM