test5.txt 220 Bytes
update bsth_c_s_sp_info a
set a.schedule_plan = (
select sp_id from bsth_c_s_sp_r_info b where a.id = b.sp_info_id
)
where a.schedule_plan is null

select count(*) from bsth_c_s_sp_info
where schedule_plan is null