What is Oracle SQL for - Is Less than or equal to 2 Days In the past?
I want to return the email addresses whose LASTPURCHASEDATE 'Is Is Less than or equal to 2 Days In the past?'
Is there an equivalent in SQL for the statement 'Is Less than or equal to 2 Days In the past'
I have joined three tables together; CONTACTS_LIST, Profile_Purchase_Data (which includes the field LASTPURCHASEDATE) and a Purchase table (that includes BRAND and ITEMCATEGORY). See SQL below
SELECT $A$.EMAIL_ADDRESS_, $B$.LASTPURCHASEDATE, $C$.ORDERDATE, $C$.BRAND, $C$.ITEMCATEGORY FROM $A$ INNER JOIN $B$ ON $A$.RIID_ = $B$.RIID_ INNER JOIN $C$ ON $A$.EMAIL_ADDRESS_ = $C$.EMAIL_ADDRESS_ WHERE $C$.BRAND = 'UGG' OR $C$.BRAND = 'UGG AUSTRALIA' AND $C$.ITEMCATEGORY = 'Boots' AND $B$.LASTPURCHASEDATE <= (SYSDATE - 2)