I'm trying to write some SQL to allow me to get result of possible duplicated Invoices that will have the same [same Items, with Same Quantity], That is possible to be Duplicate issued
Invoice items Average around 300 Item
Total Invoice To be Revision around 2500 Invoice
The Following is a invoices sample with only 1 items or so, but in real population items average is 300
Inv_ID Item_Code Item_Q A-800 101010 24 A-801 101010 24 A-802 202020 9 A-803 101010 18 A-804 202020 9 A-805 202020 9 A-806 101010 18
Hoping The Excepted Result will be
A-800, A-801 A-802, A-804, A-805 A-803, A-806
But the invoice has around 200 item, and the duplicated invoices has to be has the same items and exact same quantity for these.
It's SQL_Server
And The Result need to match the whole Invoices item Like Invoice A has 300 Different Items line with each one Quantity 2 The Results need to be all invoice has the exact same 300 Item with the Exact Quantity.
The Supplier has issued multiple duplicated invoice to our accounting Department by mistakes over 4 years, it was discovered by chance, so we need to find out the duplicated invoice to remove it from payment schedule.
The issued invoices Need to has the exact different items with exact quantity to be considered duplicated.,,,