Don wrote:
>
> Hi,
>
> I have a table called Ports that contains Port information and has
> several columns. I've designated the Portname column as Primary as it
> is unique (I did not specify it as unique). When I do a:
>
> SELECT * FROM Ports;
>
> It does NOT show the table contents in index order (Portname beginning
> with "A" all the way through "Z") but rather in the order they were
> entered.
>
> So, it seems to me that indexes are only used for querying. If I run
> through the data or issue the above SELECT statement, how do I display
> my rows in Primary Key order?
>
> Thanks,
> Don
select * from Ports order by Portname
you do not need a key to do that, but it does make it faster.
this is standard SQL so if you are stuck there you should probably
consdier reading one of the many sql manuals on the web.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php