日期:2014-05-17  浏览次数:20903 次

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;