I have 3 tables with those relevent fields
posts (id,title)
tags (id,name)
tags_map (id,id_post,id_tag)<
Try the below code:
$this->db->select('pt.*,group_concat(tg.name order by tg.id) as thetags,group_concat(tg.relevance order by tg.id) as therelevances');
$this->db->from('posts pt');
$this->db->join('tags_map tm', 'tg.id_post = pt.id');
$this->db->join('tags tg','tg.id =tm.id_tag');
$this->db->group_by('pt.id');