Search notes:

Oracle aggregate functions: MEDIAN

create table tq84_median (
  val number
);

insert into tq84_median values (     1);
insert into tq84_median values (     2);
insert into tq84_median values (     3);
insert into tq84_median values (     4);

insert into tq84_median values (100000);
insert into tq84_median values (400000);
insert into tq84_median values (999999);

select
  avg   (val) avg_,
  median(val) median_
from
  tq84_median;
-- 
--       AVG_    MEDIAN_
-- ---------- ----------
--     214287          4

drop table tq84_median;
Github repository Oracle-Patterns, path: /SQL/select/aggregate/median.sql

See also

aggregate function

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758203932, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/select/aggregate/median(61): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78