Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql return two max values
Message
From
08/09/2003 10:30:16
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Sql return two max values
Miscellaneous
Thread ID:
00827089
Message ID:
00827089
Views:
61
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
Next
Reply
Map
View

Click here to load this message in the networking platform