Skip to content
Advertisement

How can I select the max for a maths operation and also other elements without the max displaying all results

I am trying to find the maximum value of something, while also selecting other attributes at the same time. When i do the max statement on its own, it works as intended, but when I select another attribute it displays every attribute as if the max statement wasn’t there. How do I get this to work?

code that works:

code that returns all data, not just the max:

Advertisement

Answer

The way I read it, would your query – slightly modified, so that it uses the MAX function in its analytic form – do the job?


Or, is this what you’re looking for? Use the MAX date difference as a subquery:

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