$sql = "SELECT COUNT(a.result_valueId) AS total, SUM(a.result_valueId) AS grand_total, b.rv_name
FROM ufc_result AS a
JOIN ufc_result_value AS b ON a.result_valueId = b.result_valueId
GROUP BY a.result_valueId";
Use a separate SUM query.
Your query returns multiple rows, while total sum is a single row result, so instead of adding a field with the same value (grand_total) to every row, you should use a separate query.
There are 10 types of people in this world, those who understand binary and those who don't