Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameters for Order by in SQL?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00131023
Message ID:
00131081
Vues:
17
>>Sinppage
>>>
>>>Just my .02 (US) here. I'd opt for names. I think it's more flexible. Using the field number ties query to the order of the field within the table. If the structure changes, say a new field is inserted, then this would have to change too. Using the name doesn't have this problem.
>>
>>George,
>>
>>While I always prefer names too, I have had many cases where the field number was the only way to get an ORDER BY to work!
>>
>>Cheers,
>>
>>Jim N
>
>Hidy Jim,
>
>The only place that I *think* (I'm sticking my neck out here) that I've run into that was in doing a SELECT..FROM...UNION ALL... situation, where fields were re-named. Since, however, I had control over the order of the fields, I don't think it applies to this case. However, if you've encountered it elsewheres, I'd be glad to hear about it.

You probably saw, that I retyped some explanation from VFP Help. When you use field name Fox takes order from source tables (and confuses if you UNION different ones), when you use numbers Fox check result table.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform