gathering total items sold through SQL query