Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select max sum amount
Message
 
 
À
06/09/2011 10:59:05
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01522791
Message ID:
01522796
Vues:
33
In this case just use MAX aggregate function instead of the SUM.

>Sorry Antonio
>
>I updated the message to say can I have the max for each member_ref
>
>
>>Can
>>
>>ORDER BY total DESC
>>
>>do the trick?
>>
>>>Hi
>>>
>>>I have
>>>
>>>
>>>
>>>select sum(amount) as [total],
>>>		member_ref,
>>>		description 
>>>from payments 
>>>where description like '%Test%' 
>>>group by member_ref,description 
>>>
>>>
>>>
>>>how can I select out only the maximum sum amount.
>>>
>>>Thanks
>>>
>>>Nick
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform