17,090
社区成员
发帖
与我相关
我的任务
分享
SELECT t.name, to_char(s.logtime, 'HH24:MI')
FROM T_USR t, T_ACS s
WHERE t.id = s.gid AND
s.logtime BETWEEN trunc(SYSDATE, 'MI') - 3 / 144 AND SYSDATE;
select t.name,to_char(s.logtime,'HH24:MI')
from T_USR t,T_ACS s
where t.id = s.gid and s.logtime<sysdate-1/48;
--你这个什么版本?
--sysdate-1/48 半个小时就是1/48天
SQL> select to_char( sysdate - interval '30' minute,'yyyymmdd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE-I
-----------------
20101206 18:31:20
select t.name, to_char(s.logtime, 'HH24:MI')
from T_USR t, T_ACS s
where t.id = s.gid
and s.logtime < sysdate - interval '30' minute
select t.name,to_char(s.logtime,'HH24:MI')
from T_USR t,T_ACS s
where t.id = s.gid
and s.logtime>=sysdate-1/48;