您的位置:首页 > 数据库 > Oracle

oracle中的时间查询

2016-12-13 16:55 232 查看
sql语句:

select * from date_test dt where dt.date_test >= to_date('2014/6/18 10:10:00','yyyy/mm/dd hh24:mi:ss') and dt.date_test < to_date('2016/6/28','yyyy/mm/dd');

to_date()函数,第一个可以是字符串值,第二个是转换结果的时间格式,hh24表示24小时制,hh表示12小时制

也可以用:

select * from date_test dt where dt.date_test between to_date('2014/6/18 10:10:00','yyyy/mm/dd hh24:mi:ss') and to_date('2016/6/28','yyyy/mm/dd');
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: