Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameters for Order by in SQL?
Message
De
30/08/1998 10:04:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00131023
Message ID:
00131353
Vues:
28
>>>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.
>
>Hidy yourself Cetin,
>
>I'm sure that there are a number of places where a number is required. However, I can only speak from my own experience. I simply have run into them. Maybe it's because I only do simple (yeah, right) queries. Or maybe it's the nature of the ones I do. If you could elaborate on this, I'd be grateful.
>
>tia,
George,
This is from a real app :
SELECT irsno, urun, ;
        SUM(adet) as adet, ;
        SUM(kilo) as kilo, ;
        .T. AS dummy ;
	FROM fatview ;
	WHERE !EMPTY(irsno) ;
	GROUP BY irsno,urun ;
        ORDER BY 4 ;
        INTO CURSOR q1  && I needed ordering by sum(weight-kilo)
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