I have the following table with the following fields:
jexp_vikappointments_emp_worktime
=>id (primary key)
=>id_employee
=>id_service
=>day
=>fromts
=>endts
=>ts
=>closed
I am wanting to make a duplicate of all records where id_employee equals 1 but at the same time update id_employee for the new record to 2.
I don’t mind doing this in two steps if its easier i.e. make a straight duplicate and then run a second query which updates the id_employee for all id (primary key) above a certain number.
I tried playing with the following command:
insert into `jexp_vikappointments_emp_worktime` (SELECT id_service,day,fromts,endts,ts,closed FROM `jexp_vikappointments_emp_worktime` where id_employee="1")
But I have two issues:
1 I kept getting duplicate ID errors
2 For the above command I am not sure how to add the updated id_employee