首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

sql语句如何拼能满足这个功能

2013-08-01 
sql语句怎么拼能满足这个功能我现在有个表table1,表中有两个子段1:IP, 2:currentTimecurrentTime的格式为:

sql语句怎么拼能满足这个功能
我现在有个表table1,表中有两个子段1:IP, 2:currentTime
currentTime的格式为:yyyy-MM-dd HH:mm:ss
我想select下table1,将符合条件的第一条记录的IP取出来
条件是:拿当前系统时间减去表中currentTime时间的值小于10秒 sql oracle ?复合查询
[解决办法]
select ip from table1 where (SYSDATE-currentTime)*24*3600 < 10
[解决办法]
select ip from table1 where (SYSDATE-currentTime)*24*3600 < 10 and rownum=1;

热点排行