I have rows in my Salestable where I want to find duplicated rows with different salesid.
F.ex. There is a transaction where CustomerKey, Quantity, AccountNumber is dublicated in the database.
The only thing that is not the same is the SalesOrderId but to know that there is a dublicated transaction,
the other SalesOrderID with the same CustomerKey, Quantity and Accountnumber are the same, but the transaction
createddatetime is within 5 minutes between those two transactions.
Any Idea how I could write my query to find all SalesOrderId where above criteria is matched?
SalesOrderID Customerkey AccountNumber Quantity CreatedDateTime
5001 250 1100 1350 2015-08-19 09:16:31.000
5002 250 1100 1350 2015-08-19 09:20:01.000