Skip to content
Advertisement

select max, min row for each group without subquery with case of same [closed]

I’m trying to avoid sub queries because it generally takes longer to run. Came across this solution which works nicely but has a snag when there is another person with the same role with the same amount

For example, lets add another row

Is it possible to change the T-SQL code to pick either Steven or John as the top paying DevOps Engineer without using sub-queries? It doesn’t matter which one

https://www.eversql.com/select-max-min-last-row-for-each-group-in-sql-without-a-subquery/

Advertisement

Answer

Well here is one way to tackle the problem as long as you don’t care which Devops Engineer is the highest paid:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement