“Median Mysql” Code-Antworten

Median Mysql

SELECT x.val from data x, data y
GROUP BY x.val
HAVING SUM(SIGN(1-SIGN(y.val-x.val))) = (COUNT(*)+1)/2
Bored Coder

Median Mysql

SET @rowindex := -1;
 
SELECT
   AVG(d.distance) as Median 
FROM
   (SELECT @rowindex:=@rowindex + 1 AS rowindex,
           demo.distance AS distance
    FROM demo
    ORDER BY demo.distance) AS d
WHERE
d.rowindex IN (FLOOR(@rowindex / 2), CEIL(@rowindex / 2));
Tú Phan

Median Mysql

2222244
Wicked Whale

Ähnliche Antworten wie “Median Mysql”

Fragen ähnlich wie “Median Mysql”

Weitere verwandte Antworten zu “Median Mysql” auf Sql

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen