I have mysql query like this :
SELECT branch,ifnull(cluster,'Total --->')AS cluster,COUNT(rs) AS point,
(SELECT SUM(rp) from full_mcd
where full_mcd.cluster=sefiia_registered_outlet_rs.cluster GROUP BY full_mcd.cluster)
AS RP FROM sefiia_registered_outlet_rs GROUP BY branch,cluster WITH ROLLUP
result:
---------------------------------
|Branch |Cluster |Point |RP |
---------------------------------
|branch a |Cluster 1 |1000 |200|
---------------------------------
|branch a |Cluster 2 |2000 |50 |
---------------------------------
|branch a |Total --->|3000 |50 |
---------------------------------
|branch b |Cluster 4 |1000 |120|
---------------------------------
|branch b |Cluster 3 |1000 |100|
---------------------------------
|branch b |Total --->|2000 |100|
---------------------------------
the result was good except row Total---> for column RP. how can i fix this ??