A trigger can not modify the same table to which it is linked.
The simplest solution I can think of is to write a procedure to insert values that makes the necessary update:
create table x (
id int unsigned not null auto_increment primary key,
nombre varchar(50),
estado enum('Si','No')
);
delimiter //
create procedure insertaEnX(n varchar(50), e char(2))
begin
if e = 'Si' then
update x
set estado = 'No';
end if;
insert into x(nombre, estado) values(n, e);
end //
delimiter ;
Example of use:
call insertaEnX('Nombre 1', 'Si');
select * from x;
| id | nombre | estado |
|----|----------|--------|
| 1 | Nombre 1 | Si |
call insertaEnX('Nombre 2', 'No');
select * from x;
| id | nombre | estado |
|----|----------|--------|
| 1 | Nombre 1 | Si |
| 2 | Nombre 2 | No |
call insertaEnX('Nombre 3', 'Si');
select * from x;
| id | nombre | estado |
|----|----------|--------|
| 1 | Nombre 1 | No |
| 2 | Nombre 2 | No |
| 3 | Nombre 3 | Si |