mysql user variable assignement with count(*)
问题 I try to do query with a user variable, but I don't understand why, i can't update the variable in the query. I want to sum the grouped result for each day to do a chart. That really simple. SET @total := 0; SELECT "total Register", li.registerDate, @total := COUNT(*) + @total as registerNumber, @total FROM calendar c3 INNER JOIN ( SELECT c2.ide_calendar as ide_calendar, c2.name, DATE_FORMAT(i.date_creation, "%Y-%m-%d") as registerDate FROM calendrar c2 LEFT JOIN inscription i ON i.ide