Oracle:to_date和to_char

日期和字符串转换:

select * from tb_name where TIMECOL >= to_date('2018-01-01 00:00:00', 'yyyy-MM-dd HH24:mi:ss') and TIMECOL < to_date('2018-02-01 00:00:00', 'yyyy-MM-dd HH24:mi:ss');

 -- 以下语句实现同样功能但效率非常低
select * from tb_name where '2018-09-11 00:00:00' <= to_char(TIMECOL, 'yyyy-MM-dd HH24:mi:ss');
posted @ 2019-01-02 14:14  xuejianbest  阅读(357)  评论(0编辑  收藏  举报