I am trying to create a sql statement for the following:
I have a Video database- a film table and a rentals table which are linked by filmid
Within Rentals table I have Date_Returned and Date_of_rental as fields (date datatypes).
I am trying to create a query will return the film titles for rentals where the date_returned minus sysdate is greater than 2 or where date_returned minus date_of_rental is greater than 2. I am getting a multiplicative effect... Can anyone tell me what I am doing wrong?!
from film f, rentals r
where (sysdate - date_returned) > 2
or (date_returned - date_of_rental) >2
and f.filmid = r.filmid