Hi there, I hope your appreciated help.
This is my problem.
I need in mysql this output:
Result: Total recorded 219, 161 females, 58 males.
And try this query:
mysql> SELECT SQL_CALC_FOUND_ROWS
COUNT(*) AS `number`,
CASE
WHEN Sexo = 'F' THEN
CONCAT(COUNT(*), ' ', 'females')
WHEN Sexo = 'M' THEN
CONCAT(COUNT(*), ' ', 'males')
ELSE
CONCAT(COUNT(*), ' ', 'Total')
END s
FROM
`tbl_online`
WHERE
1
GROUP BY
`Sex` WITH ROLLUP;
+--------+-------------+
| number | s |
+--------+-------------+
| 161 | 161 females |
| 58 | 58 males |
| 219 | 219 Total |
+--------+-------------+
3 rows in set
But I don’t understand how to make the Result
in my output.
Can you help me? thank you in advance.
Your help would be very appreciated