Determine where error

I need to know determine error

SELECT DISTINCT Grade , ID FROM studentgrade ORDER BY Grade DESC
WHERE count(Grade)=
(SELECT count(Grade) FROM studentgrade WHERE ID=109)

you can’t use an aggregate function like COUNT() in the WHERE clause

you can’t use an aggregate function without a GROUP BY clause unless you’re counting all rows

what you want to achieve (a rank for a specific row) will require sql that looks like this – http://www.sitepoint.com/forums/showpost.php?p=4782963&postcount=2

you might also want to send a message to flower.pink19 as it appears you are both working on the same homework assignment

see http://www.sitepoint.com/forums/showthread.php?t=725435

how interesting that both of you seem to have “flower” in your user names…

:slight_smile:

You also can’t put a WHERE clause after an ORDER BY clause like you have done.