I am trying to yield a the top person by weight in the below script. I have a working version way below which returns Matt Holiday with 250 as weight, and now that is all i want The player with Max weight and him only not anyone else
SELECT DISTINCT n.fname, n.lname, MAX(n.weight) FROM master n
JOIN (SELECT b.id as id, b.year as year, b.triples as triples FROM batting b
WHERE year == 2005 AND triples > 5) x
ON x.id = n.id
ORDER BY n.weight DESC;
now this comes up with an error like this
Failed: Semantic Exception [Error 10128]: Line 4:34 Not yet supported place for UDAF 'MAX'
However this script returns what i expected, output below
SELECT DISTINCT n.fname, n.lname, n.weight FROM master n
JOIN (SELECT b.id as id, b.year as year, b.triples as triples FROM batting b
WHERE year == 2005 AND triples > 5) x
ON x.id = n.id
ORDER BY n.weight DESC;
output
Matt Holiday 250
Bill Dickey 205
Bob Feller 200
Tom Glavine 190