DEV Community

sanghamitra1994
sanghamitra1994

Posted on

Target table cannot be same one for update clause in mysql

I have a table name named 'employee'. Table creation code given below:

create table employee(name varchar(50),ph_no varchar(10),e_id varchar(5),pay_scale varchar(5),year varchar(4))

The table content is like below:

insert into employee(name,ph_no,pay_scale,year) values('AMIT','123456','PL-10','2019');
insert into employee(name,ph_no,pay_scale,year) values('AMIT','123456','PL-10','2020');
insert into employee(name,ph_no,pay_scale,year) values('AMIT','123456','PL-11','2021');
insert into employee(name,ph_no,pay_scale,year) values('AMIT','123456','PL-11','2022');

+------+--------+------+-----------+------+
| name | ph_no  | e_id |

Top comments (0)