Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regarding INDEX UNIQUE and SELECT DISTINCT...
Message
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01074757
Message ID:
01074759
Views:
20
>I was wondering about the behavior exhibited by VFP with respect to the actual record chosen (when more than one matches) with specific commands:
>
>1. INDEX UNIQUE - If there are duplicate values for the index expression, is it always the first instance of the corresponding record [here I mean lowest VFP RECNO()] that is actually indexed?


According to the help: "UNIQUE stores the matching index key only for the first record that matches the specified index expression".

>2. SELECT DISTINCT - Same question.

Your question is irrelevant because the whole record is compared.


>3. Group By (using the pre-VFP9 illegal syntax where you leave non-aggregate field names out of the group-by clause) - Same question

The fields come from the last physical record in the group.

>For me this is particularly useful info to know for INDEX UNIQUE and SELECT DISTINCT because I _do_ want to get the very first physical record that matches, as this also correlates timewise with record insertion (i.e., a lower Recno() means that record was inserted first).

I would rather use queries that relies on the data than on particular non-stabndard VFP behavior. It's more relable and much easier to port to some other backen in the future.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform