Weather Observation Station 5

  • + 4 comments

    Oracle provides the FETCH FIRST mechanism which allows you to select n rows with order by. This is much better then SELECT * around your whole statement.

    For example:

    SELECT CITY, LENGTH(CITY) FROM STATION ORDER BY LENGTH(CITY),CITY FETCH FIRST 1 ROWS ONLY;
    

    Note: The Orderby is executed before we fetch the first row.