Andrew,

I think you'll get what you want if you add "order by fieldname desc" on the
end of your query, but that's only because the order you have specified
happens to be in reverse ascii order.

Andy

> -----Original Message-----
> From: Andrew Braithwaite [mailto:[EMAIL PROTECTED]
> Sent: 11 May 2005 12:53
> To: mysql@lists.mysql.com
> Subject: RE: Remove 1st 3 Chars
> 
> Hello,
> 
> Is there any way to get MySQL to return the results of this query with
> the 'fieldname' in the order listed in the in() bit?
> 
> select fieldname from tablename where fieldname in
> ('B4079','B4076','B4069','B4041','A4710','58282','58220','56751','56728'
> ,'45003','09234','04200','04035','04026');
> 
> i.e. I want row 1 to have fieldname=' B4079', row 2 to have
> fieldname='B4076', etc.
> 
> Or is there any other way to list the results by the order as defined in
> a list specified in the query.
> 
> Please don't reply saying that I should do this in the application layer
> as that isn't an option.
> 
> Thanks for any help at all on this...
> 
> Cheers,
> 
> Andrew
> 
> MySQL, Query
> 
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]




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

Reply via email to