We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The following is full one query to solve the problem
'''sql
select city,name_lenght
from (
select city,name_lenght,
rank() over(order by name_lenght desc,city asc) as lnth_desc,
rank() over(order by name_lenght asc,city asc) as lnth_asc
from(
select city,char_length(city) as name_lenght
from station
) x order by name_lenght desc
) x where lnth_asc<2 or lnth_desc<2 order by city;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 5
You are viewing a single comment's thread. Return to all comments →
The following is full one query to solve the problem
'''sql
select city,name_lenght from (
) x where lnth_asc<2 or lnth_desc<2 order by city;