• + 0 comments

    check this out.... what's wrong in this?

    with cte as (select city, length(city) as len, row_number() over (partition by city order by length(city) asc) as rasc, row_number() over (partition by city order by length(city) desc) as rdsc, from station)

    select cte.city, length(cte) from cte where city.rasc = 1 or city.rdsc = 1