MySQL Forums
Forum List  »  Newbie

Primary Key Number Sort Issue
Posted by: Robin Rembish
Date: July 21, 2005 05:57AM

According to the MySql Reference Manual, under Create Table Syntax, "index values are always stored in ascending order."

I have found this to be true when the primary key is a character rather than a number.

In testing with a MySql Database, I noticed that when the primary key is a number, and a record is inserted into the table, the record is displayed at the bottom of the table and not in sorted order.

For example, if I have these Order Numbers in the table and then later add Order Number 1073, instead of appearing after 1072, it will be displayed after 1075. Of course, I could use "order by" to sort these numbers.

1072
1074
1075

Outside of deleting and recreating the table, is there any way to create a table that will automatically display primary key numbers in sorted order?

Thanks,

Robin

Options: ReplyQuote


Subject
Written By
Posted
Primary Key Number Sort Issue
July 21, 2005 05:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.