Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql delete row with auto increment

SET @num := 0;

UPDATE tableName SET id = @num := (@num+1);

ALTER TABLE tableName AUTO_INCREMENT = 1;


<!-- @Zenonymous -->
Comment

PREVIOUS NEXT
Code Example
Sql :: find lowest number in sql 
Sql :: oracle create table auto generated primary key 
Sql :: drop df constraint sql server 
Sql :: how to delete user in mysql 
Sql :: concat column data in sql laravel 
Sql :: postgresql insert column 
Sql :: datediff in sql server 
Sql :: postgres concat 
Sql :: mysql change password 
Sql :: how to drop a table in mysql 
Sql :: postgresql add column 
Sql :: how to export only procedures mysql 
Sql :: mysql replace string in table 
Sql :: mysql replace remove html tag 
Sql :: sql query to get the number of rows in a table 
Sql :: show table postgres command 
Sql :: where id is in list sql 
Sql :: alter table add multiple columns postgresql 
Sql :: how to query without duplicate rows in sql 
Sql :: oracle tablespace tables list 
Sql :: sql all columns 
Sql :: how to put value in variable mysql 
Sql :: postgres extract day from date 
Sql :: How to add a Try/Catch to SQL Stored Procedure 
Sql :: android sqlite add column if not exists 
Sql :: test the postgresql db connection 
Sql :: mysql collation for all languages 
Sql :: join multiple tables sql 
Sql :: remove foreign key constraints in postgres 
Sql :: mysqlclient error 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =