| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: does a table always need a PK?
"Mikito Harakiri" <mikharakiri_at_ywho.com> wrote in message
news:4Ls5b.22$eu1.271_at_news.oracle.com...
> MEDIAN is redundant:
select sum(sal)/count(1) from (
select
sal,
(select count(1)+1 from emp ee where ee.sal < e.sal) rn
from emp e
select min(rn) from (
select
(select count(1)+1 from emp ee where ee.sal < e.sal) rn,
(select count(1) from emp) rowcount
from emp e
select max(rn) from (
select
(select count(1)+1 from emp ee where ee.sal < e.sal) rn,
(select count(1) from emp) rowcount
from emp e
![]() |
![]() |