Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameters for Order by in SQL?
Message
De
29/08/1998 12:30:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00131023
Message ID:
00131274
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.
Hidy George,
Don't think I'm a number fan but I find a lot of other places too. Union is the most common as you said. Also ie: percentages and order by them even in FP 2.x
select myvalue*100/myoverall as percent .. order by 1
and other combined, udf() etc all need numbers (no corresponding field). In places where fit regularly I prefer names too of course.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform