Updated basic SUM query