I’ve a query in PL-SQL. I want to select records where date difference to current is more then a day and some other conditions…
select round(sysdate - u.RecordDate) as deleteme,
round(sysdate - u.Payment_date) as payment,
nvl(isverified, 0) as Verified
from user_cards u
where ((round(sysdate - u.RecordDate) > 0) || (round(sysdate - u.Payment_date) > 0))
and nvl(isverified, 0) = 0
order by id desc
but there is a problem here where ((round(sysdate - u.RecordDate) > 0) || (round(sysdate - u.Payment_date) > 0))
ANY IDEA HOW CAN I GET RECORDS WHERE DATE DIFFERENCE IS MORE THAN A DAY???
To get records with date difference is more than a day it is enought to substract date and test for greater than 1:
For your code:
More info: http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i48042