insert into spn_prod.staff_experience
SELECT 0 as id,
		concat('N',
            if(sss.staff < 10,
                LPAD(sss.staff, 2, '0'),
                sss.staff)) as staff_id,
		if(INSTR(substring(ssj.YEAR, 1, 4), "/"),
			concat("19", substring(ssj.YEAR, INSTR(substring(ssj.YEAR, 1, 4), "/")+1, 2)),
			substring(ssj.YEAR, 1, 4)) as from_year,
		if(
			INSTR(substring(ssj.YEAR, instr(ssj.YEAR, "-")+1, 4), "/"),
			concat("19", substring( substring(ssj.YEAR, instr(ssj.YEAR, "-")+1), INSTR(substring(substring(ssj.YEAR, instr(ssj.YEAR, "-")+1), 1, 4), "/")+1 ) ),
			substring(ssj.YEAR, instr(ssj.YEAR, "-")+1, 4)
		) as to_year,
		ssj.JOB_EXP as organization,
		ssj.POST as position,
		ssj.DUTY as responsibility
FROM spn_staff.jobexp ssj
left join spn_staff.staff sss on ssj.PID = sss.id
order by sss.staff;

update spn_prod.staff_experience set staff_id = "N403" where  staff_id = "N04"