Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering table
Message
 
À
21/01/2005 04:14:02
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00979204
Message ID:
00979390
Vues:
9
>Dear all,
>
>I would like to ask how to
>1. To select from a table, namely StockPurchase, like so "SELECT DISTINCT sCode, sDetail, sID FROM stockPurchase WHERE sID= ?lsID AND oMID = ?loMID"
>2. Then, add other associate field from the same table eg. pCost,pDiscount,oMID
>
>The one I think of as follows:
>
>
>SELECT sCode, sDetail,pCost,pDiscount,sID,oMID FROM stockpurchase where exists;
>(SELECT DISTINCT sCode, sDetail, sID FROM stockPurchase WHERE sID= ?lsID AND oMID = ?loMID) ORDER BY sCODE
>
>
>However, duplicate records show up?! Where is the problem?
>
>Thanks in advance

There's nothing in your query that would cause duplicates, so the duplicates you're seeing must be in the data. There's nothing in your query that would eliminate duplicates if you have multiple records for the same sID and oMID. How are you defining "duplicate"? Is the pCost and pDiscount duplicated?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform