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

Click here to load this message in the networking platform