clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335521 fiddles created (27407 in the last week).

create table test (id serial primary key); insert into test values (), (), (), (), (); delete from test where id=3; select * from test;
id
1
2
4
5
 hidden batch(es)


UPDATE test SET id = @num := @num +1 WHERE id > 0 ORDER BY id; select * from test;
Data truncated for column 'id' at row 1
 hidden batch(es)


set @num:=0; UPDATE test SET id = @num := @num +1 WHERE id > 0 ORDER BY id; select * from test; SHOW CREATE TABLE test;
id
1
2
3
4
Table Create Table
test CREATE TABLE `test` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
 hidden batch(es)


ALTER TABLE test auto_increment = 1; SHOW CREATE TABLE test;
Table Create Table
test CREATE TABLE `test` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
 hidden batch(es)