I have this sql query where I want to retrieve the sum of the amount of sales in August 2005. Whenever I run this, I receive the error "Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause". How can I fix this so it displays all columns and display the sum in my repsales.amount column?
SELECT *, SUM(repsales.amount) AS amount
FROM repsales
WHERE repsales.saledate BETWEEN '2005-08-01' AND '2005-08-31'