Hi there, I hope your appreciated help.
This is my problem.
I need in mysql this output:
And try this query:Code:Result: Total recorded 219, 161 females, 58 males.
But I don't understand how to make the `Result` in my output.Code: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
Can you help me? thank you in advance.
Your help would be very appreciated



Reply With Quote
Bookmarks