sql >> Database teknologi >  >> RDS >> Mysql

MySQL Beregn procentdel

prøv dette

   SELECT group_name, employees, surveys, COUNT( surveys ) AS test1, 
        concat(round(( surveys/employees * 100 ),2),'%') AS percentage
    FROM a_test
    GROUP BY employees

DEMO HER




  1. Hvad er Oracle-datoformateringsmasken for tidszoner?

  2. Find byer inden for 'X' kilometer (eller miles)

  3. Bedste praksis for MySQL-databaseoptimering

  4. Mysql multiple row insert-select-sætning med last_insert_id()