and (to_date(t.time,'yyyy-mm-dd hh24:mi:ss')- to_date(fro.time,'yyyy-mm-dd hh24:mi:ss'))>3
以上的sql是有问题的,我要的答案是t.time-fro.time>3秒的sql怎么写,谢谢了。
以上的sql是有问题的,我要的答案是t.time-fro.time>3秒的sql怎么写,谢谢了。
解决方案 »
- 为什么运行exec无法执行存储过程,提示无效sql语句
- sql server 中基础概念 如何和oracle中的对应起来,和谁对应?up 有分
- ORACLE 10G的列表分区的值是否支持类似如下形式:PARTITION BY LIST (SUBSTR(CODE,1,2))
- 关于CASE的问题
- dmp是oracle数据格式吗?
- 超级简单问题,sql语句中查询某个时间字段为当前日期的应该怎么写?
- 新手求救,急救
- Oracle8i启动后,例程启动,但是数据库没有启动
- 我的ora8i中有个两个数据库A、B,我在oem中移去了一个A,在磁盘上A的文件没有删除。现在OEM里面只有B库了,我想把
- 问个sql
- sqlserver的存储过程转换成oracle版本的,帮忙改下,学习下。
- SQL*LOADER中使用序列失败 求助 很急 100分
(to_date(t.time,'yyyy-mm-dd hh24:mi:ss')-
to_date(fro.time,'yyyy-mm-dd hh24:mi:ss'))*24*60*60>3
--例如:
select (sysdate-to_date('20101111','yyyymmdd'))*24*60*60 from dual
(SYSDATE-TO_DATE('20101111','YYYYMMDD'))*24*60*60
-------------------------------------------------
221335
2、oracle中两相日期不能相加,但日期可以加上或减去一个数值,这个数值也是天。
更详细:日期操作
如: interval '3' second 来表示3秒
上述条件可以这样写:
and (to_date(t.time,'yyyy-mm-dd hh24:mi:ss') - interval '3' second >to_date(fro.time,'yyyy-mm-dd hh24:mi:ss'));
(to_date(t.time,'yyyy-mm-dd hh24:mi:ss')- to_date(fro.time,'yyyy-mm-dd hh24:mi:ss'))*24*60*60>3
(to_date(t.time,'yyyy-mm-dd hh24:mi:ss')- to_date(fro.time,'yyyy-mm-dd hh24:mi:ss'))>3/(24*60*60)
and (to_date(t.time,'yyyy-mm-dd hh24:mi:ss')- to_date(fro.time,'yyyy-mm-dd hh24:mi:ss'))>3/(24*60*60);