SELECT d.`comic_id`,d.`title`,d.`title2`,d.`comic_market_id`,d.`remark`, d.`cover_version` , ii.`ext` , d.`score` as score , d.`turnout` as turnout , d.`num_fav` as favorite , (select sum(ct.`score`) from comic_tag ct where ct.is_deleted = 0 and ct.`comic_id` = d.`comic_id` and ct.`tag_id` = '27 ' ) as 'total_of_tag' FROM `comic` d , `image_info` ii , `comic_tag` ct where d.`status` ='1' and d.`comic_id` = ii.`comic_id` and (d.`comic_id` = ct.`comic_id` and ct.is_deleted = 0 and ( ct.`tag_id` = '27 ' ) ) group by d.`comic_id` having total_of_tag > 0 ORDER BY `total_of_tag` Desc, `favorite` Desc ,`score` Desc ,`turnout` Desc , d.`sort_order` DESC , d.`comic_id` DESC