You are here: Re: MYSQL REORDER PRIMARY KEY « PHP SQL « IT news, forums, messages
Re: MYSQL REORDER PRIMARY KEY

Posted by Captain Paralytic on 07/25/07 14:02

On 25 Jul, 14:44, zach <wackzi...@gmail.com> wrote:
> Is there a way to sort all the data in my database such as alphabetical
> or something, and then once sorted and have all the primary key's redone
> according to the sorted order? I can sort them how I want, but I don't
> know if there is a way to rename the primary id key on all the data once
> sorted.
>
> Thanks for any help.
>
> zach

Why does it matter? Your primary key is a way to uniquely identify the
record. The database system can store them in any order it wants.
If the primary key for a row is FR67T before the table is sorted, then
it can still be the primary key after?
If you want a simple integer value primary key, then (depending on the
RDBMS you are using)you can use a counter to insert the records in a
new table with the required values or possibly use an auto-increment
column.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация