如何使用oracle查询仅从今天的日期获取以前日期不存在的数据
How to get the data only from the todays date which are not exists in previous dates using oracle query
这是我的 table :
Id date interfaceid
------------------------------
1 10-12-2015 1502
2 10-01-2015 1560
3 10-04-2015 1502
4 10-03-2015 1502
5 10-09-2015 1555
6 10-12-2015 1569
在这个数据中我们必须找出以前日期不存在的今天(10-12-2015)的数据
试试这个:
select * from yourtable
where datecol = '10-12-2015'
and value not in(select value from yourtable where datecol <> '10-12-2015')
这是我的 table :
Id date interfaceid
------------------------------
1 10-12-2015 1502
2 10-01-2015 1560
3 10-04-2015 1502
4 10-03-2015 1502
5 10-09-2015 1555
6 10-12-2015 1569
在这个数据中我们必须找出以前日期不存在的今天(10-12-2015)的数据
试试这个:
select * from yourtable
where datecol = '10-12-2015'
and value not in(select value from yourtable where datecol <> '10-12-2015')