How to get the percentage in SQL

0

The amounts that I handle to make the query are:

(3427.2*100)/3716041.16 = 108427.9049953314659197012138188608776844

How to get it done that throws the percentage in whole because how will the system know that the percentage is 108%

SELECT (SUM(COBRADO) * 100) / SUM(TOTAL)
FROM CL_RP_COBRANZA_TNR_TEORICO
WHERE TO_CHAR(FECHA_VENCIMIENTO,'MM/RRRR')='10/2015' AND
      ESTADO='HGO' AND
      SECCION='15'
ORDER BY ESTADO, SECCION, FECHA_VENCIMIENTO;

I hope you can help me

    
asked by Jonathan Garcia 09.08.2018 в 18:55
source

1 answer

0

I hope it will help you if you want something more just detail it

mysql

select CONCAT(FORMAT((sum(cobrado)*100)/sum(total),2),'%') as procentaje 
from cl_rp_cobranza_tnr_teorico where DATE_FORMAT(fecha_vencimiento,'%e/%Y')='10/2015'
and estado='hgo' and seccion='15' ORDER BY estado , seccion, fecha_vencimiento
    
answered by 09.08.2018 в 20:07