CodePudding user response:
1. Create your summary table2. Write a stored procedure, including your business logic, and probably the following syntax:
Insert into the summary table (c1 and c2,,,)
Select sum (),,,
The from list
Group by,,,
3. Create a job, execute the stored procedure regularly, write data to the summary,