Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding records with unique order number?
Message
De
23/11/1999 13:14:57
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00294401
Message ID:
00294439
Vues:
19
>Is there a quick method of selecting records where only a single instance of the order number exists?
>
>I have a situation where we want to fill orders where only 1 certain item was ordered. If the order has more than this one item, we want to wait until we can ship the order complete.
>
>I think that a SELECT DISTINCT will return the order number of all orders which contain that item, whether or not multiple items exist for the order. We don't want that.
>
>The only other process I have envisioned is to loop through and check for other items having the same order number and discard the record if they exist.
>
>Am I on the right track, or is there a simpler way?
>
>Thanks,
>
>Neil Preston

SELECT COUNT(*), OrderID FROM Mytable GROUP BY OrderID HAVING COUNT(*) = 1
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform