CREATE TABLE documents (access_count INT, document_type_code VARCHAR)

Find the total access count of all documents in the most popular document type.
SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1
SELECT SUM("access_count") FROM "documents" GROUP BY "document_type_code" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1