Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ORDER BY versus INDEX ON...issues?
Message
De
11/08/2004 12:48:46
Scott Malinowski
Arizona Fox Software LLC
Arizona, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00932358
Message ID:
00932404
Vues:
16
Could this have anything to do with the fact that two of the index fields could be NULL? That is, the join for two of the tables is a LEFT OUTER JOIN which means the records without a matching join will contain NULLs. That's the one thing I do notice when I test the supposed blank fields, they have NULLs in them.

Which makes them sort ike:

AAA NULL NULL
CCC NULL NULL
AAA AAA AAA
BBB AAA BBB
CCC CCC CCC

Hmmmmmmmmmmmmmm???????????????????????????????



>Hi Mark!
>
>COLLATE is set to "MACHINE". However, when I change to GENERAL, I get the same results?
>
>Scott
>
>What is SET("COLLATE") set to? I get the results you expect on a cursor [i.e., not testing on a view] using MACHINE and GENERAL.
>
>>Greetings!
>>
>>I have a local view in a VFP8 SP1 application that joins a few tables and orders by three character fields of length 30, 15 and 60. The sequence is perfect when I order the view in that manner. However, when I add an index to the view at runtime with the same exact sort order, the sequence it not what you think it would be.
>>
>>Anyone else had any issues like this? It is really bizarre and a key issue, since I want to allow the user to view reports in multiple sort orders by simple selecting a sort order from a pull-down menu. This works fine in other circumstanecs...I believe. I'll double check that to be sure. Here's an example of the data:
>>
>>1) fld1 = "AAA" fld2 = "" fld3 = ""
>>2) fld1 = "AAA" fld2 = "AAA" fld3 = ""
>>3) fld1 = "AAA" fld2 = "AAA" fld3 = "AAA"
>>4) fld1 = "BBB" fld2 = "BBB" fld3 = "BBB"
>>5) fld1 = "CCC" fld2 = "" fld3 = ""
>>
>>indexing on fld1 + fld2 + fld3 you would think would give the order I posted. It doesn't. It orders like this:
>>
>>1) AAA
>>5) CCC
>>2) AAA AAA
>>3) AAA AAA AAA
>>4) BBB BBB BBB
>>
>>Any thoughts or ideas would be greatly appreciated!
>>
>>Thanks in advance!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform