Identifying duplicate entries based on differences
Posted on 2008-10-02
I just asked a question about duplicate invoices, and now I have another. I need to be able to identify duplicate invoices that have the same invoice number and are for the same amount but that have different vendor names. For example, in a table called Invoices:
INVOICE_NUMBER, AMOUNT, VENDOR_NAME
001, $100, Geico
001, $100, Geico Insurance
002, $100, Geico
I would want the query to return the first two but not the third, since it has a different invoice number and is probably the next month's bill instead of a duplicate. Any help would be appreciated.