Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    While interesting use of VALUES inline like that, I'm not sure this is simpler than CASE or IFF. I'd be interested to see how the performance of this solution stacks up against the other options though Commented Jan 31, 2020 at 22:43
  • @ChrisSchaller the interesting part with this usage of VALUESis that it provides an easy way to check more than one column for the MAX value. As for the performance, I do not know :) Commented Aug 31, 2021 at 18:40
  • @mortb this answer is a blatant rip off the earlier one from stackoverflow.com/a/52296106/1690217 I'm starting to see the value in this, but not sure I would call it "simple" We're effectively UNPIVOTing the values so that we can use an aggregate over the inner set. Its elegant, low code, but complex to understand. Commented Sep 2, 2021 at 1:33