select session_id
from as_sessions
where staff_id = :user_id
select session_id
from as_sessions
where subject_id = :user_id
select section_data_id
from as_section_data
where subject_id = :user_id
select section_data_id
from as_section_data
where staff_id = :user_id
select item_data_id
from as_item_data
where subject_id = :user_id
select item_data_id
from as_item_data
where staff_id = :user_id
update as_sessions
set staff_id = :to_user_id
where staff_id = :from_user_id
update as_sessions
set subject_id = :to_user_id
where subject_id = :from_user_id
update as_section_data
set subject_id = :to_user_id
where subject_id = :from_user_id
update as_section_data
set staff_id = :to_user_id
where staff_id = :from_user_id
update as_item_data
set subject_id = :to_user_id
where subject_id = :from_user_id
update as_item_data
set staff_id = :to_user_id
where staff_id = :from_user_id