Analytic Syntax DENSE RANK (Ranking)
Hallo Leute
ich habe eine Tabelle, in der ich gerne den Rang (Platzierungen) berechnen möchte.
Ich habe es mit DENSE RANK mal versucht, es klappt aber nicht.
SELECT bc_code, lv, mark,
DENSE_RANK() OVER(PARTITION BY bc_code ORDER BY mark) AS drang,
RANK() OVER(PARTITION BY bc_code ORDER BY mark) AS rang,
ROW_NUMBER() OVER(PARTITION BY bc_code ORDER BY mark) AS nummer
FROM tbc
kann es sein, dass es nur von Oracle unterstüzt wird. Ich arbeite nämlich mit MySQL.
Gibt es eine ander möglichkeit ranking zu berechnen.
Ich würde mich über eure Hilfe freuen.
Gruß Sweety
ich habe eine Tabelle, in der ich gerne den Rang (Platzierungen) berechnen möchte.
Ich habe es mit DENSE RANK mal versucht, es klappt aber nicht.
SELECT bc_code, lv, mark,
DENSE_RANK() OVER(PARTITION BY bc_code ORDER BY mark) AS drang,
RANK() OVER(PARTITION BY bc_code ORDER BY mark) AS rang,
ROW_NUMBER() OVER(PARTITION BY bc_code ORDER BY mark) AS nummer
FROM tbc
kann es sein, dass es nur von Oracle unterstüzt wird. Ich arbeite nämlich mit MySQL.
Gibt es eine ander möglichkeit ranking zu berechnen.
Ich würde mich über eure Hilfe freuen.
Gruß Sweety
Please also mark the comments that contributed to the solution of the article
Content-Key: 75646
Url: https://administrator.de/contentid/75646
Printed on: April 25, 2024 at 17:04 o'clock