hi all,
i have been trying to use this code so to rank Agents in table. I want to rank them as they offered product to the same user, but the agent who offered first will have rank 1, and the other is rank 2.
SELECT A.ID, A.Type, A.CDate, Count(*) AS Rank
FROM yourTable AS A INNER JOIN yourTable AS B ON A.Type = B.Type AND A.CDate >= B.CDate
GROUP BY A.ID, A.Type, A.CDate
but i have same error
you tried to execute a query that does not include the specified expression 'some filed that i don't need'as part of an aggregate function.
can anyone help me plase
i have been trying to use this code so to rank Agents in table. I want to rank them as they offered product to the same user, but the agent who offered first will have rank 1, and the other is rank 2.
SELECT A.ID, A.Type, A.CDate, Count(*) AS Rank
FROM yourTable AS A INNER JOIN yourTable AS B ON A.Type = B.Type AND A.CDate >= B.CDate
GROUP BY A.ID, A.Type, A.CDate
but i have same error
you tried to execute a query that does not include the specified expression 'some filed that i don't need'as part of an aggregate function.
can anyone help me plase