Hey smart guys. I am having problems with the following SQL statement. I know that I cannot do GROUP BY in an OnlineStatus column, and that makes sense because it is a function call, not the actual column in my table. How can I change this so that I can calculate the number of users on the network?
SELECT CASE dbo.fnGetWebUserOnlineStatus(W.Id) WHEN 1 THEN 'Online' WHEN 2 THEN 'Ingame' ELSE 'Offline' END AS OnlineStatus FROM dbo.WebUsers W WHERE W.[Status]=1 GROUP BY OnlineStatus
source share