I am having issues in adjusting this query to grab the top 10 selling styles by dept. I have seen various examples around the web on how to do this with a sub query but none of them have conditions or joins included so I am a bit lost.
My current query is below. Any help would be appreciated!
SELECT
T1.DEPT,
T1.SKU,
T1.COLOR,
SUM(T1.SALES) AS Sales,
SUM(T1.GP) AS GP
FROM Table1 T1
INNER JOIN Table2 T2 ON T1.Date = T2.Date
WHERE
T2.Year = '2017'
AND T2.Month in ("July, August")
GROUP BY
T1.DEPT,
T1.SKU,
T1.COLOR
ORDER BY 4