Try "order by id". All the best, Jayasimhan A ----- Original Message ----- From: Mickael Bailly <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 22, 2002 3:13 PM Subject: keeping given order in resulset
> > Hello ! > > I got a table having an auto_increment field, let's say 'id'. tis table has a > varchar field too, let's say 'name'. > > Is there a way to do something like: > > select id, name from table where id in (5,3,7) > > AND that mysql orders the results the way I gave into the 'IN(...)' clause ? > > So I would have resultset like: > > | id | name | > | 5 | 'foo' | > | 3 | 'bar' | > | 7 | 'foobar' | > > > Thanks, > > Mickael > > --------------------------------------------------------------------- > 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 > --------------------------------------------------------------------- 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