【发布时间】:2021-06-03 19:36:33
【问题描述】:
平均击球次数 = 总得分 / 超时次数。
在这里我们需要确保包括用完(在非前锋端)
输出如下:
Batsman_name Average
KL Rahul 44
错误:
SQL 语句中的错误:AnalysisException: cannot resolve '
batsman_runs' given input columns: [_auto_generated_subquery_name.Batsman];第 1 行,第 21 行; '排序 ['Average DESC NULLS LAST], true
select Batsman_, sum(batsman_runs)/count(player_dismissed) as Average
from
(
(select batsman as Batsman_ from IPL_BALL_BY_BALL)
union all
(select non_striker as Batsman_ from IPL_BALL_BY_BALL)
)
group by Batsman_
order by Average desc;
【问题讨论】: