SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table routes (route_id int, trunk_id int, seq int); insert into routes values (16,117,0), (16,118,1), (16,120,2), (16,121,3); select * from routes; update routes set seq = if(trunk_id = 121, 0, seq+1) where route_id = 16; select * from routes order by seq;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear