怎么获取当前时间前30分钟数据
select t.name,to_char(s.logtime,'HH24:MI') from T_USR t,T_ACS s where t.id = s.gid
and to_date(s.logtime,'HH24:MI') < to_date(sysdate,'HH24:MI')-30我的思路是这样,但是有问题
select t.name,to_char(s.logtime,'HH24:MI') from T_USR t,T_ACS s where t.id = s.gid
and to_date(s.logtime,'HH24:MI') < to_date(sysdate,'HH24:MI')-30我的思路是这样,但是有问题
解决方案 »
- EXPDP
- 关于Oracle9i本地数据的可逆加密
- 这种查询如何实现?
- 执行存储过程只能执行一次的问题
- 求语句
- 表关联 更新优化
- oracle一个表有char(1)类型字段,里面记录字符'A','B'.....,请问我想对这个char进行加减运算,得到另外一个字符,如'A'+1='B',请问如何
- 在线等待,一个SELECT INTO相关的SQL语句如何写
- 请问如何在一个数据库的存储过程中调用另一个数据库的存储过程?
- oracle816:在启动OracleoraHomeManagementServer时提示:在本地计算机无法启动OracleoraHomeManagementServer服务。错误997:重叠I/O操作
- 请问 txt := N' < ' 是什么意思?
- oracle中pl/sql编程 编写1+2+3+。。。。+100的和??
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;
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
能解释下什么意思吗?
谢了
--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-1/48;
FROM T_USR t, T_ACS s
WHERE t.id = s.gid AND
s.logtime BETWEEN trunc(SYSDATE, 'MI') - 3 / 144 AND SYSDATE;