我正在尝试执行此代码,但它说我在row_number()
表达式中遗漏了一些我根本无法弄清楚的东西。
with summary as
(select s.city, length(s.city) as C_length,
row_number() over (partition by length(s.city), order by s.city)
as r1 from station s
where
length(s.city) = (SELECT min(LENGTH(s1.CITY)) FROM STATION s1)
or length(s.city) = (SELECT max(LENGTH(s2.CITY)) FROM STATION s2))
select su.city, su.C_length
from summary su;