Получите данные из нескольких таблиц в SQL и Node JS

var db = require('../dbconnection');
var moment = require('moment');
var HomeCounter = {
    countviewunview: function (id, callback) {
        var querystring = "SELECT (SELECT COUNT(call_id) FROM call_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='n') AS Calllogsunviewed" + ","
                + "(SELECT COUNT(call_id) FROM call_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='y') AS Calllogsviewed"+","
                + "(SELECT COUNT(sms_id) FROM sms WHERE is_synch=1 AND phone_service_id=? AND is_viewed='n') AS Smslogsunviewed" + ","
                + "(SELECT COUNT(sms_id) FROM sms WHERE is_synch=1 AND phone_service_id=? AND is_viewed='y') AS Smslogsviewed" + ","
                + "(SELECT COUNT(photo_id) FROM photo WHERE is_synch=1 AND phone_service_id=? AND is_viewed='n') AS Photounviewed" + ","
                + "(SELECT COUNT(photo_id) FROM photo WHERE is_synch=1 AND phone_service_id=? AND is_viewed='y') AS Photoviewed" + ","
                + "(SELECT COUNT(id) FROM mic_bug_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='n') AS MicBugunviewed" + ","
                + "(SELECT COUNT(id) FROM mic_bug_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='y') AS MicBugviewed" + ","
                + "(SELECT COUNT(id) FROM camera_bug_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='n') AS CameraBugunviewed" + ","
                + "(SELECT COUNT(id) FROM camera_bug_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='y') AS CameraBugviewed" + ","
                + "(SELECT COUNT(id) FROM spy_vid_cam_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='n') AS VideoBugunviewed" + ","
                + "(SELECT COUNT(id) FROM spy_vid_cam_log WHERE is_synch=1 AND phone_service_id=? AND is_viewed='y') AS VideoBugviewed";

        return db.query(querystring, [id, id, id, id, id, id,id,id,id,id,id,id], callback);
    }
};
module.exports = HomeCounter;
Wassi