Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique but not unique
Message
From
21/08/2008 10:23:06
 
 
To
20/08/2008 19:47:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01340637
Message ID:
01340752
Views:
11
>How would you insure that the entries in a given field are unique OR blank? That is, multiple blank records are OK but if data is entered, it must be a unique value. Setting up a candidate index doesn't work due to the blank fields.

SELECT cField, CNT(*) AS nCnt ;
FROM YourTable ;
WHERE NOT EMPTY(cField) ;
GROUP BY cField ;
HAVING nCnt > 1 ;
INTO CURSOR Dups

This gives you a list of duplicate values.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform