I have 2 tables: Product
, User
.
Product:
Date(Datetime)
Phone_Number(Number).
User:
Date (Datetime)
Phone_Number(Number)
Type(Value of N or C).
When a new user is added to the User
table, it is given a date, Phone Number and value of "N" (N for New).
When a user gets cancelled, it is given a date, the Phone Number and value of "C" (C for Cancelled).
Using MySQL, I need to find out the date difference between the Date the user was created and the date the user was cancelled and if they had a product (can match the user to the product by Phone Number) between the date of the creation and the date of the cancellation.
Any assistance would be greatly appreciated as my Query writing isn't terrible but this I can't work out.
Thanks.