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

From: Lauri Pietarinen <lauri.pietarinen_at_atbusiness.com>
Date: Tue, 11 Nov 2003 17:32:26 +0200
Message-ID: <3FB1010A.1030302_at_atbusiness.com>


Bob Badour wrote:

>"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.
>
>
>
OK, but is

select top 5 * from (
  select * from emp order by sal
)

legal SQL now a'days?

Is it supported in products?

regards,
Lauri Received on Tue Nov 11 2003 - 16:32:26 CET

Original text of this message