1. Have table of 10,000,000 Customers [ customer name, customer #, transaction date, salesperson ]
2. Have table of 10,000 customer invoices - relevant fields are: [transaction#, transaction_type, transaction date, customer_name, salesperson ]
3. Have table of 1,500 customer return invoices - fields[transaction#, transaction_type, transaction date, customer_name, salesperson]
4. Definition of transaction# - every record has a unique ascending transaction# and every transaction# is created in sequential order and defined by the [transaction_type]
I'm looking Query those tables for the following info:
5. Find all transactions where [customer_name ] had a [transaction#] within 10 numbers of another [transaction#] of the same customer.
I am also looking to find sequential transactions with the same customers. i.e. all situations where a customer transaction# is within 1 of another.