Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql return two max values
Message
De
08/09/2003 10:30:16
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Sql return two max values
Divers
Thread ID:
00827089
Message ID:
00827089
Vues:
60
Hello:

I'm trying to create a sql statement (or series of) that would allow me to identify what vendor record has the max(invoice_date) and max(invoice_amount). Not the aggregate values all of venders. I need to get the max(invoice_amount) because we can have mulitple records with the same invoice date. Invoice number may not be unique in this situation.

I was able to create one sql statement with a subquery to return max(invoice_date) for each vender, but having two max requirements got be bogged down.


Regards,

Steve
Steven Ellis
steve@ellisconnection.com
617 680-5997
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform