开发者

Trying to count number professors in dept order by desc

SELECT P.pID FROM Department D, Professor P
WHERE D.dID = P.dI开发者_JS百科D
ORDER count(pID);

Mysql, keeps throwing an error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'count(pID) LIMIT 0, 30' at line 3


ORDER needs to be ORDER BY.


You are missing a BY.

The query should be:

SELECT P.pID FROM Department D, Professor P
WHERE D.dID = P.dID
ORDER BY count(pID);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜