SQL分组、统计、排序的查询

SQL分组、统计、排序的查询:
SELECT count( id ) cnt, category, computername
FROM `computer` 
WHERE (
category = 'notebook'
OR category = 'desk-top'
)
GROUP BY computername ASC 
LIMIT 0 , 100

还不知道怎么用“order by”来排序,像下面这样就会报错:
SELECT count( id ) cnt, category, computername
FROM `computer` 
WHERE (
category = 'notebook'
OR category = 'desk-top'
)
ORDER BY computername
GROUP BY computername 
LIMIT 0 , 100 


环境:MySQL5.0

你可能感兴趣的:(sql)