Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using MAX()/MIN() functions together?
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Using MAX()/MIN() functions together?
Divers
Thread ID:
01089853
Message ID:
01089853
Vues:
70
For some reason I'm having a difficult time coming up with a good query that does what I need to do. Basically, I have a sample table and data like the following:

EmpID EmpName DeptID Salary Age
------- ---------------- -------- --------- ------
100 James Doe 001 50,123 34
101 John Smith 002 63,590 42
etc..

I need to find just one employee for each department that is the youngest by age with the highest salary. If there are more than one with the same attributes I still just need one regardless which one employee that is.

What's a good query to pull this off? Thanks.
It's "my" world. You're just living in it.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform