• For that query to work it should be grouped by salescategory, salesperson, otherwise you will get this error when running the query

    Columns salescategory, salesperson are invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.