insert into spn_prod.staff_training
SELECT
	0 as id,
	concat('N',
            if(sss.staff < 10,
                LPAD(sss.staff, 2, '0'),
                sss.staff)) as staff_id,
	sst.PROGRAM as course_name,
	sst.ORGANIZATION as organization,
	sst.DATE as date,
	sst.HR as hours
FROM
    spn_staff.trainstaff ssts
        left join
    spn_staff.train sst ON ssts.PID = sst.id
		left join
	spn_staff.staff sss on ssts.STAFF_ID = sss.ID
Order by sss.staff;

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