Max Video Learn

دورات اون لاين احترافيه مع شرح عربي مع ابقاء المحتوى بالأنجليزي للنجاح في الامتحانات مثل امتحانات الأوراكل و غيرها

Top-N Queries

Top-N Queries in oracle can be in many methods:

example 1:using the rownum

select salary
  from
  (
  select salary from employees
  order by salary desc
  )
where rownum<=3;

 

example 2: using fetch

select salary
from
employees
order by salary desc
fetch first 3 rows only

 

Leave a Reply


You must be logged in to post a comment.