1
I work for a telephone charging system company, all calls generated by the central (PABX) are charged by the system and stored in a call table cadcha.
cadcha
------------------------------------------
nreg | telefone | ramaldestino | teldata | telpretot
1000 35420000 6050 03/08/2015 2,50
1001 35428790 6050 03/08/2015 1,20
1002 33590000 6050 03/08/2015 2,50
telpretot = link value.
To make a sum, for example, I already have the following consultation working:
SELECT SUM(telpretot)
FROM cadcha
WHERE teldata = '08/03/2015'
AND
ramaldestino = '6050';
Now, I wonder, how would be this same query to calculate the statistical fashion, IE, the value that more appeared in the records of cadcha table.