I have a mysql table with 4 columns (3 PKs and the last column for an integer value). I need to sum all the integer values in the last column for every 1,296 rows. Is there an easy query to do this (I’m a little new to queries so be nice!)?
If it helps, the first column contains the same value for 1,296 rows (ex. there are 1,296 rows that have ‘AAA’ for that column’s value, and then 1,296 rows that have ‘AAB’ for that column’s value, etc.).
SELECT first_column_name, SUM(last_column_name) FROM table_name GROUP BY(first_column_name);