I have a visitors’ table with the country and the total number of visitors.
I am getting results from the below query country and visitors count.
I want to know % of visitors from by country.
SELECT distinct country, count(*) as count FROM visitors
GROUP BY country
ORDER BY count DESC
I think I need to calculate the percentage in PHP based on the total count of visitors.
Like (10/100)*100 = 10% but when the visitor’s max count is 175060, how to decide out of total % I mean 100 in the previous calculation.