views:

36

answers:

1

I am trying to get the number of users for each age. What is wrong with this sql query for odata.stackoverflow.com?

select age, count(*) 
from users 
order by age 
group by age
+4  A: 

Use:

  select age,count(*) 
    from users 
group by age 
order by age 

ORDER BY is always last

OMG Ponies
bingo... you beat me to it...
NinjaCat
Thanks so much. I have ran into this problem several times over the past few years and always used a simple work around instead of digging into it.
EddieC