Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Order of a SQL on a SUM column
Message
De
07/04/2001 19:28:16
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
07/04/2001 16:27:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00493266
Message ID:
00493290
Vues:
17
Michel,

The following will also work:
SELECT NonMember2, SUM(Point) AS SumOfPoint ;
  FROM Point ;
  INTO CURSOR Temp ;
  GROUP BY NonMember2 ;
  ORDER BY SumOfPoint DESCENDING
Your problem was that it didn't know which "Point" to order by.


>
>How come on the following SQL:
>>
>>
>>SELECT NOMEMBER2,SUM(POINT) AS POINT FROM POINT;
>> GROUP BY 1 ORDER BY POINT DESCENDING INTO CURSOR TEMP
>>
>>
>>I would end up with a sort with the following values in my POINT column: 10, 10, 2, 2, 12?
>>
>>The record with 12 as the POINT value should be ranked 1st.
>
>Order by 2 solved it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform