我正在尝试使用窗口功能查找唯一的城市,我无法在此查询中使用别名
select branch,city,row_number() over(partition by city order by branch) as row_number from
sales_report where row_number=1;
Error in query: cannot resolve '`row_number`' given input columns:
我正在尝试使用窗口功能查找唯一的城市,我无法在此查询中使用别名
select branch,city,row_number() over(partition by city order by branch) as row_number from
sales_report where row_number=1;
Error in query: cannot resolve '`row_number`' given input columns:
1条答案
按热度按时间lnvxswe21#
where子句中不能有窗口函数。将其放入子查询中,然后进行筛选: