开发者

Trying to count number professors in dept order by desc

开发者 https://www.devze.com 2023-03-29 04:50 出处:网络
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
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

精彩评论

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