I have a question that I can't find the answer to.
I have the following:
I want to sort the result by Occurances. I understand that I can't use an alias in the ORDER BY clause. I tried copying the sub query into the ORDER BY clause, but that gave me a syntax error message.Code:SELECT DISTINCT Staff.Manager, (SELECT COUNT(Manager) FROM Audit WHERE Comment = 'Warning' AND Manager = Staff.Manager) AS Occurances FROM Staff
Any advice on how to achive this would be greatly appreciated.
Thanks