Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - When is SELECT DISTINCT not DISTINCT ?
Message
From
19/08/1998 15:01:24
 
 
To
19/08/1998 14:12:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00128215
Message ID:
00128237
Views:
18
>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 ! )

Did you try reindexing?

PS. Though it has nothing to do, I would suggest using SPACE(xxx) instead of strings of spaces.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform