Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECTing records which are NOT DISTINCT
Message
 
To
28/04/1998 10:36:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00095346
Message ID:
00095483
Views:
21
>>I need some help to figure out how I can find out which records are being
>"dropped" when I do a SELECT * DISTINCT. I did a search for this and came
>up with some suggestions but they don't seem to fit this situation. One of
>the suggestions was:
>>
>>
>I don't exactly understand what you mean by "dropped".

What I meant was, when I did a SELECT * DISTINCT, all my duplicated records are reduced to just one record. So the others are "dropped". This is a program that is taking accounting data from one system and formatting it to be imported into another accounting system. I'm doing the SELECT * DISTINCT to eliminate duplicate entries (someone's mistake) so they don't migrate into the new system. But, they want a way of tracking what I've eliminated so if they can't balance their books, they have a starting place on where to look.

>
>Also, do you mean GROUP BY field2 in the above?

Using the code someone else suggested, I could find a duplicate entry (on only one field) by using the GROUP clause. By using that, and COUNT(field) I would then have an extra field in my query that contained the number of duplicates found. Then it'd be really easy to filter out only the entries that had a count > 1. These were the ones I was dropping. But since I need the record to be distinct across several (all, actually) fields I wasn't able to use the GROUP BY option.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform