EddieC
EddieC

Reputation: 144

What is wrong with my sql query of odata?

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

Upvotes: 0

Views: 428

Answers (1)

OMG Ponies
OMG Ponies

Reputation: 332681

Use:

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

ORDER BY is always last

Upvotes: 4

Related Questions