| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Extending my question. Was: The relational model and relationalalgebra - why did SQL become the industry standard?
>
>
>What happens here if the 10th and 11th ranking of employees by salary have the
>same salary? Should you not get a compile error if salary is not unique
>within emp?
>
In that case both 10th and 11th will be included, as stated in TTM.
In practice, if you want _exactly_ 10 values (provided there are at
least 10 employees) you could include the key
in the ranking, e.g.
SELECT emp OVER{salary,empno} WHERE deptno=1 RETURN 10 BY {salary desc, empno}
>I'm rather partial to DB2's
> RANK() OVER ()
>and
> RANK_DENSE() OVER()
>
>for quota queries.
>
>
That's interesting.... How would that previous query look like
in DB2?
regards,
Lauri Pietarinen
Received on Fri Feb 21 2003 - 01:41:55 CST
![]() |
![]() |