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

Do you want max(invoice_amount) for max(invoice_date) or they are independent? Is there a unique key in this table?

>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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform