Re: Extending my question. Was: The relational model and relationalalgebra - why did SQL become the industry standard?

From: Lauri Pietarinen <>
Date: Fri, 21 Feb 2003 09:41:55 +0200
Message-ID: <>

>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 ()
>for quota queries.

That's interesting.... How would that previous query look like in DB2?

Lauri Pietarinen Received on Fri Feb 21 2003 - 08:41:55 CET

Original text of this message