Re: Is relational theory irrelevant?

From: Bob Badour <bbadour_at_golden.net>
Date: Fri, 14 Nov 2003 22:09:58 -0500
Message-ID: <9uWdnXfLwYU8ByiiRVn-vg_at_golden.net>


"Mikito Harakiri" <mikharakiri_at_iahu.com> wrote in message news:oCctb.23$6v2.33_at_news.oracle.com...
>
> "Christopher Browne" <cbbrowne_at_acm.org> wrote in message
> news:bp3ir9$1k22pm$3_at_ID-125932.news.uni-berlin.de...
> > I would have thought that taking the various
> > "LIMIT" and "OFFSET" "TOP" keywords and standardizing it would be more
> > sensible.
>
> I suggest that all those goofy keywords are redundand if we have RANK():
>
> select * from (
> select ename , sal, rank() over (order by sal desc) as rnk from emp
>
> ) where rnk <=5
>
> > The rank functions look to me as though they have the potential to get
> > _really_ expensive to evaluate, and not because they are buying some
> > massive advantage.
> >
> > Fabian Pascal presents, as a "standard" way of doing it,
> > SELECT a.ename, a.sale_amt
> > FROM sales a, sales b
> > WHERE a.sale_amt <= b.sale_amt
> > GROUP BY a.ename, a.sale_amt
> > HAVING COUNT(*) <= q
> > ORDER BY a.sale_amt
>
> In Date's article credit goes to Adrian Larner.
>
> Besides, there seems to be an error here:
>
> > WHERE a.sale_amt <= b.sale_amt
> ------------------^^^^
> a.sale_amt < b.sale_amt

The actual correction should be:

( a.sale_amt < b.sale_amt OR a.ename = b.ename ) Received on Sat Nov 15 2003 - 04:09:58 CET

Original text of this message