SELECT `a`.*, `b`.`relations`, `c`.`level` as `level_academic`, `d`.`action_efective_date`, `e`.`type` as `action_type`
FROM `user__family_member` `a`
JOIN `_ref__relationship` `b` ON `b`.`id` = `a`.`relation`
LEFT JOIN `_ref__academic` `c` ON `c`.`id` = `a`.`academic_lavel`
LEFT JOIN `user__profiling` `d` ON `d`.`id` = `a`.`profiling_id`
LEFT JOIN `_ref__action_type` `e` ON `e`.`id` = `d`.`action_type_id`
WHERE `a`.`user_id` = '105'
AND a.profiling_id IN (SELECT MAX(a.profiling_id)
FROM `user__family_member` `a`
WHERE `a`.`user_id` = '105'
AND `a`.`is_delete` =0)
AND `a`.`is_delete` =0