我试图在下面的脚本中按重量产生一个最高人物。我有一个工作版本的方式,它以 250 的重量返回 Matt Holiday,现在这就是我想要的最大体重的球员,只有他不是其他人
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;
现在出现了这样的错误
Failed: Semantic Exception [Error 10128]: Line 4:34 Not yet supported place for UDAF 'MAX'
然而这个脚本返回我所期望的,输出如下
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;
输出
Matt Holiday 250
Bill Dickey 205
Bob Feller 200
Tom Glavine 190