Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtering table
Message
 
To
21/01/2005 04:14:02
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00979204
Message ID:
00979390
Views:
8
>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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform