Allow WHERE and HAVING to use columns and add SUM aggregate function