Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Best way to check a table for duplicates???
Hello once again. It's your for neighborhood novice back for advice.
I have a table that has sale orders. Sometimes the customer does 2 or 3 sales. I would like to check the table for the same customer then combine those records into 1, deleting the others. The cost would then be record1.cost + record2.cost + record3.cost.
I started to use a temp table to compare the two but I keep running into walls. For instance, how to add the cost when I'm comparing the exact same tables to each other. When comparing the two tables, if I have 3 similar records on each one(e.g. same customer name), would the reccount() = 3 or 9?
I would appreciate any help and thanks,
Sunshine
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement