select `complaints`.*, (selectcount(*) from `complaint_like` where `complaints`.`id` = `complaint_like`.`complaint_id`) as `likes_count`, (selectcount(*) from `complaint_message` where `complaints`.`id` = `complaint_message`.`complaint_id`) as `messages_count` from `complaints` where `complaints`.`brand_id` in (14) and `status` in (4, 5, 6, 7)