我对alias
. 例如,下面的查询工作正常
select * from
(
select ROW_NUMBER() over (partition by prodid order by quantity desc) as 'rankin',prodid,quantity from sales
) A
where rankin=1
但是,当我按照下面的片段所示对其进行修改时,我得到了错误:“无效的列名'rownumber'”。
select ROW_NUMBER() over (order by quantity) as 'rownumber' from sales
where rownumber = 1
请说明区别。