SELECT *,(CHAR_LENGTH(related_pro_cat) - CHAR_LENGTH(REPLACE(related_pro_cat, ',', '')) + 1) as total FROM #__articles WHERE (FIND_IN_SET('48',related_pro_cat) AND FIND_IN_SET('166',related_pro_cat) OR related_pro_cat IN(48,166)) AND article_id !=323 AND is_suggestion=1 AND article_status=1 order by total DESC limit 8