Cross-database compatible selecting number of comments