Hello:
I am trying to find a way to write an Oracle query (11g) that finds repeat customers transaction purchases that occur within 72 hours of each other. Specifically, if a customer does a transaction on Day 1, and then again on Day 2, I would like to have a query that will pull the transaction record from Day 2.
My table DAILYTABLE captures records for transactions by customers and has timestamps for the transaction completion time (DISCHARGE_TS). I would like to look for repeat customer transactions by EITHER a) CUSTOMER NUMBER or b) CUSTOMER NAME and DOB (sometimes a customer will register again but have an existing customer already and will receive another number, so if we pull by customer name and DOB we will get the repeat transaction), but only if there is a repeat transaction within 72 hours of the DISCHARGE_TS.
Can anyone please help a poor newbie figure this one out?
Many thanks in advance!
E
I am trying to find a way to write an Oracle query (11g) that finds repeat customers transaction purchases that occur within 72 hours of each other. Specifically, if a customer does a transaction on Day 1, and then again on Day 2, I would like to have a query that will pull the transaction record from Day 2.
My table DAILYTABLE captures records for transactions by customers and has timestamps for the transaction completion time (DISCHARGE_TS). I would like to look for repeat customer transactions by EITHER a) CUSTOMER NUMBER or b) CUSTOMER NAME and DOB (sometimes a customer will register again but have an existing customer already and will receive another number, so if we pull by customer name and DOB we will get the repeat transaction), but only if there is a repeat transaction within 72 hours of the DISCHARGE_TS.
Can anyone please help a poor newbie figure this one out?
Many thanks in advance!
E