UPDATE
group_sub_menu
inner join group_main_menu
on group_main_menu.main_menu_id = group_sub_menu.main_menu_id
and group_main_menu.group_id = group_sub_menu.group_id
inner join
(
SELECT distinct group_id
FROM group_member
inner join employee
on group_member.member_id = employee.id
where logon_id = ?
) grp
on grp.group_id = group_main_menu.group_id
SET category_id = ?
and group_sub_menu.main_menu_id = ?
where group_sub_menu.main_menu_id = ?
and group_sub_menu.sub_menu_id = ?
group_sub_menu
inner join group_main_menu
on group_main_menu.main_menu_id = group_sub_menu.main_menu_id
and group_main_menu.group_id = group_sub_menu.group_id
inner join
(
SELECT distinct group_id
FROM group_member
inner join employee
on group_member.member_id = employee.id
where logon_id = ?
) grp
on grp.group_id = group_main_menu.group_id
SET category_id = ?
and group_sub_menu.main_menu_id = ?
where group_sub_menu.main_menu_id = ?
and group_sub_menu.sub_menu_id = ?