2 Replies Latest reply on Feb 12, 2018 6:42 AM by Apoorva S-Oracle

    Columns with same name and the use for row limit clauses

    Sylvain Nawrocki

      As per the row limiting clause

       

      https://docs.oracle.com/database/121/SQLRF/statements_10002.htm#BABHFGAA

       

      "If the select list contains columns with identical names and you specify the row_limiting_clause, then an ORA-00918 error occurs. This error occurs whether the identically named columns are in the same table or in different tables. You can work around this issue by specifying unique column aliases for the identically named columns.

      "

       

      But i was able to run the below statement without error

       

      select e.department_id, d.department_id from hr.employees e

      join hr.departments d

      on (e.department_id = d.department_id)

      order by e.employee_id

      fetch first 20 rows only

       

      Is this expected or is the error about something else ?

       

      Tx!