SQL Aggregation error and tables

Came here to make the same suggestion. It’s hard to be faster than @colin_mckibben though!