General information
Category:
Coding, syntax & commands
Title:
SQL - When is SELECT DISTINCT not DISTINCT ?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only