Showing posts with label primary key. Show all posts
Showing posts with label primary key. Show all posts

Wednesday 28 August 2019

Wednesday 1 August 2018

How to get Missing / Deleted primary key from Mysql / PHP Database

select a.id + 1 RemoveIds
from jaydip_kansagra a
left join jaydip_kansagra b
  on a.id = b.id - 1
where b.id is null
  and a.id < 14481

14481 = Last Primary Key 

Saturday 14 July 2018

Re-Arrange primary key | INDEXING in MYSQL

Re-Arrange primary key | INDEXING in MYSQL
SET @count = 0;
UPDATE `users` SET `users`.`id` = @count:= @count + 1;
Last number of records
ALTER TABLE `jaydipkansagra` auto_increment = 720418;