基本上,我想有一天回去使用查询找到数据...
这是我到目前为止:
select price from SAMPLE_DATA
where trunc(date) = '11-FEB-13'
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用时:
select price from SAMPLE_DATA
where trunc(date) = trunc(date-1)
Run Code Online (Sandbox Code Playgroud)
这不会返回任何东西.那有什么不对吗?
谢谢
您将记录中的日期与记录中日期之前的日期进行比较.您从不使用当前日期作为参考.试试这个:
select mid_price from SAMPLE_DATA where trunc(business_date) = trunc(sysdate-1)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
351 次 |
| 最近记录: |