Re: Is relational theory irrelevant? (was Re: Dreaming About Redesigning SQL)

From: Bob Badour <bbadour_at_golden.net>
Date: Tue, 11 Nov 2003 07:21:02 -0500
Message-ID: <YO-dnSsZjt7NSS2iRVn-vA_at_golden.net>


"Lauri Pietarinen" <lauri.pietarinen_at_atbusiness.com> wrote in message news:3FB0A52C.2050105_at_atbusiness.com...
> Mikito Harakiri wrote:
>
> >"Bob Badour" <bbadour_at_golden.net> wrote in message
> >news:sZqdnURpMcikvzKi4p2dnA_at_golden.net...
> >
> >
> >>"Mikito Harakiri" <mikharakiri_at_yahoo.com> wrote in message
> >>news:bdf69bdf.0311092059.7fa5b13f_at_posting.google.com...
> >>
> >>
> >>>"Bob Badour" <bbadour_at_golden.net> wrote in message
> >>>
> >>>
> >>>>Express a quota query.
> >>>>
> >>>>
> >>>select top 5 * from (
> >>> select * from emp order by sal
> >>>)
> >>>
> >>>What is the problem, besides "5*from" looking ugly?
> >>>
> >>>
> >>The ordered operand.
> >>
> >>
> >
> >OK. Then
> >
> >select EX.EMP#
> >from EMP EX
> >where (select count(1)
> > from EMP EY
> > where EY.HEIGHT < EX.HEIGHT) < 5
> >
> >
> >
> Wow! That is BEAUTIFUL! And I bet it will be easy to teach an
> optimiser how to handle it best ;-)
>
> BTW, what if you had to order on more than one column (as is often
> the case)?

In that case, he could go back to using the ordered operand, which is almost syntactic. ie. One needs to specify the ordering for a quota query, and I only objected to doing so with a single ordered operand instead of an unordered operand and an order specification. Received on Tue Nov 11 2003 - 13:21:02 CET

Original text of this message