Number records with incrementing ID (add an ID column to an existing table)


/ Published in: MySQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SET @id := 0;
  2. UPDATE users SET id = (@id := @id + 1) WHERE id = 0;

Report this snippet


Comments


You need to login to view comments.