I have a table that has several tasks, the idea is to "finish one" and start another, but I do not know how to formulate a query like this
I have the following:
create table tareas(
id int not null PRIMARY key AUTO_INCREMENT,
idvinedo int not null, idplantacion int not null,
nombre varchar(50) not null,
duracion varchar(50) not null,
orden int not null,
FOREIGN KEY (idvinedo) REFERENCES vinedo(id),
FOREIGN KEY (idplantacion) REFERENCES plantaciones(id));
The idea is that active goes to 0 and to 1 in the next row, order keeps correlatively the tasks, so it can be used to guide which is the next row to change