Hi,
You can re-wright the sql statement like the following,
select c.CommentID,c.AAA,c.CommentAddress
from Comments c
WHERE c.AAA = (select count(cs.CommentSpamID) from CommentSpams cs where cs.CommentID= c.CommentID)
Hope this will help.
Please accept this as answer if this solves your problem.