You are viewing a single comment's thread. Return to all comments →
the syntax for ORDER BY is correct. If I run the exact same query without the FETCH clause then the query works just fine.
Going off these docs, my query with FETCH should work just fine. https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1
Try this in "oracle" envoirment:
select city,length_city from (select a.*, rownum r from (select length(city) length_city,city from station order by length_city, city) a) where r in (1,(select count(*) from station))
Yes I'm using Oracle DB, as my original post stated.
Thank you for your answer, but I am wondering why Oracle's FETCH clause is not working here...
Can you explain this query?
if there are more cities with length 21 this doesnt work