SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table records(id int, name varchar(100), position int); insert into records(id, name, position) values (1, '111', 1), (2, '111', 2), (3, '111', 3), (4, '111', 4), (5, '111', 5), (6, '111', 6), (7, '111', 7), (8, '111', 8), (9, '111', 10), (10, '111', 11), (11, '111', 12), (11, '111', 100); update records set position = (select floor(rand()*(max(position) - min(position))+min(position)) from (select * from records) as t); select * from records;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear