1

after inserting 5 row of table with primary KEY and remove middle of data how to recount to fix primary counts? for example i have this row

|id |name

| 0 |mahdi
| 1 |mojtaba
| 2 |maryam

after remove mojtaba from row i have this:

|id |name

| 0 |mahdi
| 2 |maryam

how to recount id to fix this table:

|id |name

| 0 |mahdi
| 1 |maryam
DolDurma
  • 15,753
  • 51
  • 198
  • 377

1 Answers1

0

I would say this will not be FIX for primary key, it would be MESS for a primary key.

If you have this primary key as foreign key for some other tables, then handling those while updating something like above would be very tedious work.

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276