Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Menghitung Z-Score untuk setiap baris di MySQL? (sederhana)

SELECT
    mergebuys.pTime,
    (mergebuys.M1 - aggregates.AVGM1) / aggregates.STDM1 AS z1,
    (mergebuys.M2 - aggregates.AVGM2) / aggregates.STDM2 AS z2,
    (mergebuys.M3 - aggregates.AVGM3) / aggregates.STDM3 AS z3,
    (mergebuys.M4 - aggregates.AVGM4) / aggregates.STDM4 AS z4
FROM
    mergebuys
    CROSS JOIN (
        SELECT
            AVG(M1) AS AVGM1,
            STD(M1) AS STDM1,
            AVG(M2) AS AVGM2,
            STD(M2) AS STDM2,
            AVG(M3) AS AVGM3,
            STD(M3) AS STDM3,
            AVG(M4) AS AVGM4,
            STD(M4) AS STDM4
        FROM
            mergebuys
    ) AS aggregates


  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. koneksi mysql error 2049 menggunakan otentikasi lama (pra-4-1-1) dari mac

  2. Bagaimana cara memasukkan pesan email masuk ke database mySQL?

  3. Panggil ke prosedur tersimpan, ketika nama prosedur dalam variabel di mysql

  4. Konektor/J driver MySQL di Jenkins Script Console/Scriptler

  5. Hitung persentil dari frekuensi di MySQL