遇到个问题 怎样取得最近一天数据 有个时间字段 TS
解决方案 »
- Oracle ./runInstaller权限错误!
- 关于客户端连接服务器的问题
- 多表关联的删除问题
- 高手请教
- 一个表空间的信息在dba_data_files存在,却在dba_free_space中找不到
- 求帮我看看这段SQL语句
- 在连接符中使用绑定变量出错
- 求两段VB示例代码:用VB备份、及恢复ORACLE数据库。想要数据库在打开状态下也能进行的热备份
- {100分}在windows2000 professional下安装oracle817后,运行成功,当我把计算机的名称改变以后,再启动oracle时提示: ORA-12545:连接
- [ORCALE]请问一下在ORCALE中如何选取时间?
- 求数据库科普。。。
- rman备份控制文件是否同时备份spfile
from (select a.*,row_number over(order by ts desc) rn from tb) where a.rn=1
这个试试
select * from table where versions between timestamp to_timestamp(trunc(sysdate)+1/86400,'yyyymmdd hh24:mi:ss') and to_timestamp(trunc(sysdate+1)-1/86400,'yyyymmdd hh24:mi:ss') ;
-- (即24个小时前,到现在的数据,如果你的时间字段,没有比当前时间还大的数据记录行在在的话)
select * from tab where ts>= sysdate-1;
select * from tab where ts between trunc(sysdate)+1/86400 and trunc(sysdate+1)-1/86400 ;
不过我的理解是这样的:
例如:你最近一次(天?)吸烟是在什么时候?
select * from tb where f_date=(select max(TS) from tb )