Ask Your Question

Reorganizing the primary key numbering sequence. Any way to do that? [closed]

asked 2015-04-11 03:00:19 +0100

mrmister gravatar image

updated 2020-08-20 00:25:54 +0100

Alex Kemp gravatar image


I'm using the UNION statement to fusion two different tables into a single table, and the problem is I am getting a mess in my ID (primary key), so I find many registries showing the same number 1,1,1,1,2,2,2,3,3,4,4,4,4,4,4,5,5... and so on...

I'm wondering if do we have any way or method...? perhaps a SQL code... that make a miracle and reorder from 1 to the latest registry, all the registries in the right sequence, 1,2,3,4,5,etc. avoiding duplicate numbers in the primary key. Any way to solve this?

Any SQL code or method to make the miracle would be greatly appreciated


edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-08-20 00:26:17.841049

1 Answer

Sort by » oldest newest most voted

answered 2015-04-11 07:38:42 +0100

pierre-yves samyn gravatar image

Hi - This FAQ explains the different scenarios


edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-04-11 03:00:19 +0100

Seen: 119 times

Last updated: Apr 11 '15