select * from (
SELECT agency_id,username, count( authorid ) AS num,sum(replynum ) as replynum
FROM `agencypartreply`
WHERE replynum >4
AND countdate > UNIX_TIMESTAMP( '2012-09-01' )
AND countdate < UNIX_TIMESTAMP( '2012-11-01' )
GROUP BY username
) as a 
FULL  JOIN 
agencyuser as u on u.id = a.agency_id where a.num > 21