Comment Re:Greatest() (Score 1) 7
or use a dynamic temp table sub-select and the HAVING and GROUP BY aggregators.
But honestly, the GREATEST() function will work a lot easier. It's a very CPU intensive function. Writing it out using the dynamic temp table/HAVING/GROUP BY will execute quicker, but will be a lot harder to maintain.