I've come across a strange situation where I've to delete a record if there is any other record having the matching key variables. Any help would be highly appreciated. My requirement is to drop both these records from further processing. My sample data looks like below where the fields Vendor, Job and Grade are the key variables.
Vendor
Job
Grade
Payment
1
ABC
Boxes
01
$3,500.00
2
XYZ
Tape
01
$2,000.00
3
LMN
Straps
02
$1,500.00
4
ABC
Pins
02
$1,200.00
5
LMN
Straps
02
$0.00
6
ABC
Boxes
01
$3,500.00
7
LMN
Straps
02
$0.00
8
ABC
Boxes
01
$0.00
A record has to be dropped from further processing if there is another record anywhere in the table having the amount field(Payment) a value $0.
Considering this the record #1 for vendor ABC having Payment $3500 should be deleted because there is another record #8 where Payment is $0, but #6 having Payment $3500 should be processed because #8 is no more available as it is already matched(/deleted along) with #1. Similarly #5 for vendor LMN should also be dropped as there is a matching record at #7 having payment $0.
... View more