Aug 24, 2000 #1 erwan Programmer Aug 24, 2000 19 FR In sql, i want to get only 10 gretest values on a table . I try with ROWNUM with " where rownum > count(*) -10 but the "order by" is made after the rownum and the result is false. how can i do that. thank you!
In sql, i want to get only 10 gretest values on a table . I try with ROWNUM with " where rownum > count(*) -10 but the "order by" is made after the rownum and the result is false. how can i do that. thank you!
Aug 24, 2000 #2 bigscouse MIS Oct 6, 1998 420 GB the mackpei thread posted 22/8 might help. Upvote 0 Downvote
Aug 30, 2000 #4 cgordon Technical User Oct 8, 2001 3 US In Oracle use a subquery. From the Oracle course: select ename, sal from emp e where 10 > (select count(*) from emp where e.sal < sal) order by e.sal In SQLServer use: select TOP 10 ename, sal from emp order by sal Upvote 0 Downvote
In Oracle use a subquery. From the Oracle course: select ename, sal from emp e where 10 > (select count(*) from emp where e.sal < sal) order by e.sal In SQLServer use: select TOP 10 ename, sal from emp order by sal