sql時間
阿新 • • 發佈:2017-11-08
ask time 格式 -1 sda 時間 span sele lec
- create_date 格式為date
可行sql:
- select * from bus_task_order t where t.create_date>sysdate
- select * from bus_task_order t where t.create_date=to_date(‘2017-11-8 11:13:28‘,‘yyyy-MM-dd hh24:mi:ss‘)
- exe_date 格式為varchar2
可行sql:
- select * from danage_action_task tt where tt.exe_time>to_char(sysdate, ‘yyyy-mm-dd hh24:mi:ss‘)
- select * from danage_action_task tt where tt.exe_time>to_char(trunc(sysdate), ‘yyyy-mm-dd hh24:mi:ss‘)
- select * from danage_action_task tt where tt.exe_time>‘2017-11-08 11:13:28‘ varchar2格式時天不帶0是錯的
select sysdate from dual ->2017-11-8 11:13:28
select trunc(sysdate) from dual; ->2017-11-8
select to_char(sysdate,‘yyyy-mm-dd hh24:mi:ss‘) from dual;->2017-11-08 14:42:28
sql時間