Am Sunday 25 January 2004 23:17 schrieb Lorderon:
> Hello All,
>
> I got a table with a VARCHAR(255) field as a primary key, but when I insert
> a new row it inserts it ordered by the key. Then, when I select rows
> without doing any order, it returns the rows ordered by the primary key.

That's by accident. If you don't use order by, there is no guaranteed order 
and it might well change from select to select.

> How can I insert a new row to the end of the table, and select records will
> not use auto sort, but without doing an ORDER BY clause or making an
> auto_increment primary key?

You can't get a defined order without order by. I do actually not understand 
your problem. Why not use order by? Why not use auto increment? In order to 
retrieve results in the order you inserted them (that's what you want, 
right?) you need two things: First, a column which records the insert order 
(auto increment, timestamp ...) and, secondly, an order by in your select. No 
chance without these.

>
> thanks in advance,
> -Lorderon

-- 
Stefan Kuhn M. A.
Cologne University BioInformatics Center (http://www.cubic.uni-koeln.de)
ZÃlpicher Str. 47, 50674 Cologne
Tel: +49(0)221-470-7428   Fax: +49 (0) 221-470-7786
My public PGP key is available at http://pgp.mit.edu


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to