DATE_FORMAT(max(c.date_creation), '%%Y-%%m-%%d %%H:%%i:%%S') as date_last_comment,
count(distinct c.id_user) as users,
count(*) as count
FROM "cmtRECORDCOMMENT" c
%s
GROUP BY c.id_bibrec
ORDER BY count(*) DESC
LIMIT %s
"""
where_clause="WHERE "+(commentsand'c.star_score=0'or'c.star_score>0')+""" AND c.status='ok' AND c.nb_abuse_reports < %s"""%CFG_WEBCOMMENT_NB_REPORTS_BEFORE_SEND_EMAIL_TO_ADMIN
where_clause="WHERE "+(commentsand'c.star_score=0'or'c.star_score>0')+""" AND c.status='ok' AND c.nb_abuse_reports < %s"""%CFG_WEBCOMMENT_NB_REPORTS_BEFORE_SEND_EMAIL_TO_ADMIN