A
accesshacker
I am trying to perform ranking based on Total Sales and have been able to
accomplish it with the following SQL
SELECT T.Deal, T.SN, T.ST_TYPE, T.[LY Sales], (SELECT COUNT(*)
FROM ALLOC_TYPE_STORE T1
WHERE T1.[LY Sales] >= T.[LY Sales]) AS Rank
FROM ALLOC_TYPE_STORE AS T
ORDER BY T.[LY Sales] DESC;
I now need to be able to rank the sales based on their Store Type of A, B,
C, or D. There is a field in the ALLOC_TYPE_STORE table that contains the
data called ST_TYPE. I want to be able to show the ranking for each store
type starting with 1.
Any help will be greatly appreciated.
accomplish it with the following SQL
SELECT T.Deal, T.SN, T.ST_TYPE, T.[LY Sales], (SELECT COUNT(*)
FROM ALLOC_TYPE_STORE T1
WHERE T1.[LY Sales] >= T.[LY Sales]) AS Rank
FROM ALLOC_TYPE_STORE AS T
ORDER BY T.[LY Sales] DESC;
I now need to be able to rank the sales based on their Store Type of A, B,
C, or D. There is a field in the ALLOC_TYPE_STORE table that contains the
data called ST_TYPE. I want to be able to show the ranking for each store
type starting with 1.
Any help will be greatly appreciated.