Cool. Thanks, all, for the proper guidance.
This works for me (no private, no unpublished, table_prefix used):
$prefix = $modx->dbConfig['table_prefix'];
$sql = "SELECT " . $prefix . "site_content.pagetitle, count(" . $prefix . "log_access.document) AS totalView," . $prefix . "log_access.document "
."FROM " . $prefix . "log_access INNER JOIN " . $prefix . "site_content ON " . $prefix . "log_access.document=" . $prefix . "site_content.id "
."WHERE " . $prefix . "site_content.published=1 AND " . $prefix . "site_content.privateweb=0 "
."GROUP BY " . $prefix . "log_access.document ORDER BY totalView desc limit $numPages;";