sql >> Database >  >> RDS >> Mysql

SQL-rangpercentiel

SELECT  page, 
        views,
        (1-ranks/totals)*100 Percentile
FROM
(
    SELECT  page,
            views,
            @rank:[email protected] + 1 ranks,
            (SELECT COUNT(*) FROM tableName) totals
    FROM    tableName a,
            (SELECT @rank:=0) s
    ORDER   BY views DESC
) s


  1. Hoe SQLite-lengte() werkt

  2. Maak de slaapstand backquote alle tabel- / kolomnamen

  3. hoe csv naar tabel in oracle te converteren

  4. Aantal gegroepeerde rijen tellen in mysql