您的位置:首页 > 其它

ora的字符串与时间比较

2011-07-06 23:02 204 查看
select * from table_name where sysdate>=to_date(str_date1,’yyyy-mm-dd’) and sysdate<=to_date(str_date2,’yyyy-mm-dd’)    -->    失败

select * from table_name where to_char(sysdate,'yyyy-mm-dd')>=limit_date and to_char(sysdate,'yyyy-mm-dd')<=unlimit_date   -->  成功

无知确实很可怕。ora的date与varchar确实太厉害了。佩服!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: