Hi, well, I'm not totally sure about your question. Which order is reversed ? The order you get the entries with a select after the insert ? If it is this, then I think it's not a problem with the insert. The order is then given by the select, and if no order by is in the select, it is arbitrary. Since the physical order of entries in your temp table isn't of any relevance, I can't see any point in using order by in this statement. Stefan
Am Tuesday 02 September 2003 10:06 schrieb Alejandro Paz: > Hallo everyone ! > > I already sent this, but I think some people think is > not clear enough ;-) > > Im using Mysql 4.0.12 on RedHat 7.3 x86 > I know it's not the last binary but I cannot upgrade > now. (And i saw nothing about this in the changelog > for 4.013 and 4.0.14) > > I found the following : > > I have two tables : > > Stock (InnoDB, primary key on d): > a char (16) > b char (20) > c char (20) > d int > e decimal (9,2) > h int > i int > > PTemp (MyISAM, no keys): > d int > e decimal > f int > g char (1) > > And the statement I am using is : > > INSERT INTO PTemp SELECT d,e,32,'E' FROM Stock WHERE > h<i ORDER BY a,b,c; > > I am doing an insert/select with order by, in both > cases I am using the same statemant. > > When I use the same statement in my application (built > with C, and statically linked > to libmysqlclient.a) I get the reversed order (the > records that start with '0' are at the end). > > When I test the statement in the mysql cli and I get > the results well sorted (the records that start with > '0' are at the begining). > > I checked the log and both statements are equal, (but > the two users used to access the DB are different, > the mysql cli user is root, and the other just have > enough permissions to select, > update,delete and insert in the tables). > > I would like to know (if that is possible) what > happens. > > Thanks in advance. > Ale > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com -- 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]