Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - When is SELECT DISTINCT not DISTINCT ?
Message
From
19/08/1998 14:12:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL - When is SELECT DISTINCT not DISTINCT ?
Miscellaneous
Thread ID:
00128215
Message ID:
00128215
Views:
69
To anyone who has ideas:
Problem:

I execute the following sql statement to create a table of unique customer id's from a large table:
----------------------------------------------------------------
SELECT DISTINCT CUSTID AS ID,;
' ' AS FileName,;
.F. AS Success, ;
' ' AS ErrorMsg ;
FROM DataDBF ORDER BY ID
INTO DBF customer.DBF
-----------------------------------------------------------------
This sql statement has been used for a year and no problems have ever occurred, yesterday ended all that....I received 3 duplicate
records in a row:

ID FileName Success ErroMsg
ID2320 .F.
ID2320 .F.
ID2320 .F.

What is wrong with my sql statement ? I think maybe the other fields that I am creating at the same time are causing this. Should they be removed, I could use a SELECT DISTINCT ID....and then use an ALTER TABLE to add my other fields. ALSO I have been unable to recreate this behavior, but I can swear that it happend ( to my companies largest client, who received the same data three times and called everyone where I work to complain ! )

Any thoughts would be appreciated...
Bob Horkay
Next
Reply
Map
View

Click here to load this message in the networking platform