I have a table called PatientList with a field called 'city'. I want to find the TOP 10 cities for all rows. Here's my code:
SELECT TOP 10 city, newvar=Count(*)
FROM PatientList
GROUP BY city
ORDER BY newvar ASC
But I keep getting asked for a value for newvar. But newvar is supposed to be a new variable. What am I doing wrong?
SELECT TOP 10 city, newvar=Count(*)
FROM PatientList
GROUP BY city
ORDER BY newvar ASC
But I keep getting asked for a value for newvar. But newvar is supposed to be a new variable. What am I doing wrong?