In the first place those fields should not even be in the same table. Generally, you would want 3 tables:Originally Posted by dicepackage
customer: w/primary key id
invoice: with primary key invid, foreign key id
items: primary key itemid, foreign key invid
which makes it hard to generate duplicates in the first place, and time-consuming SQL creating temp tables etc... irrelevant. just .02