problem showing all dates in current month of last year
i have written this code but it only returns those with dates before the current date in the month e.g it onl returns the dates in december before the 8th as that is todays date nd i need it to display all dates in december the year before and it needs to bethe same code for next month.
select customer_id, movie_id,download_date
from tbl_download
where download_date = trunc( add_months( sysdate, -12 ), 'MM' )
i then tried adding
select customer_id, movie_id,download_date
from tbl_download
where download_date = trunc( add_months( sysdate, -12 ), 'MM' ) and download_date <= LAST_DAY(TRUNC(ADD_MONTHS(SYSDATE, -12),'MM'))
and that makes no difference. any ideas how to make this work
how to find a date 60 years from another date
i have another problem i have to run a query that finds all the movie titles of the films that have been downloaded by someone when they were 60 when they downloaded it.
in the table tbl_customer there is a column called date_of_birth
there is a download_date column in tbl_download.
im guessing i have to join the two table and somehow code where date_of_birth is >= download_date, - 60
any idea how to do this?