MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Andy Eastham Date:May 11 2005 12:31pm
Subject:RE: Remove 1st 3 Chars
View as plain text  
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:Andrew@stripped]
> Sent: 11 May 2005 12:53
> To: mysql@stripped
> 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/mysql?unsub=1



Thread
Remove 1st 3 Charsshaun thornburgh11 May
  • RE: Remove 1st 3 CharsReinhart Viane11 May
  • Re: Remove 1st 3 CharsJohan Höök11 May
RE: Remove 1st 3 CharsAndrew Braithwaite11 May
  • Re: Remove 1st 3 CharsPhilippe Poelvoorde11 May
  • RE: Remove 1st 3 CharsAndy Eastham11 May
  • Re: Remove 1st 3 CharsRoger Baklund11 May