oracle 语句取时间(times)字段 加5分钟 大于等于当前系统时间的语句怎么写

oracle 语句取时间(times)字段 加5分钟 大于等于当前系统时间的语句怎么写

1、创建测试表,

create table test_date(id number, times date);

2、插入测试数据

insert into test_date select level, sysdate-level/24/60 t from dual connect by level <= 100;

commit;

3、查询表中数据,select t.* from test_date t;

4、编写sql,获取加5分钟大于等于当前系统时间的记录; select t.* from test_date t where times+5/24/60>=sysdate;

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-11-26
先介绍时间:
1. 5分钟的实现,加上5/(24*60)就可以了
select sysdate as "当前时间",sysdate+5/(24*60) as"当前时间+5分钟" from dual;
2. 大于等于当前系统时间实现
只要加上这个where语句就行了
create_time > = sysdate;

---------------华丽丽的分割线-------------------------

所以您要的语句应该是这样的:
select times+5/(24*60) as "加5分钟",times as "不加时间" from 表
where times > = sysdate;本回答被提问者和网友采纳
第2个回答  2014-04-14
可以在代码层处理呀