MySQL: Capture every 5 values from column a in Table A to create one row in Table B
The TRIGGER can be simplified down to

INSERT ... ON DUPLICATE KEY UPDATE ...


It is not proper to have "redundant" data in a database.  Why can't you just leave it in the original table?  When you need it, do a JOIN.