set @ROW = 0;UPDATE `visitorhistory` SET `id` = @ROW := @ROW+1 ORDER BY `id` ASC;
Shopify, Shopify Apps, Magento, WordPress, Codeigniter, Joomla, Big Commerce | PHP
Showing posts with label primary key. Show all posts
Showing posts with label primary key. Show all posts
Wednesday, 28 August 2019
Re-index primary key in Mysql database table
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
Labels:
Database,
Deleted,
Missing,
Mysql,
Mysql Query,
PHP,
primary key
Saturday, 14 July 2018
Re-Arrange primary key | INDEXING in MYSQL
Re-Arrange primary key | INDEXING in MYSQL
SET @count = 0;Last number of records
UPDATE `users` SET `users`.`id` = @count:= @count + 1;
ALTER TABLE `jaydipkansagra` auto_increment = 720418;
Labels:
INDEXING,
Mysql,
PHP,
primary key,
Re-Arrange,
SQL
Subscribe to:
Posts (Atom)