Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sort an element in mysql

 
chamini prashakthi
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we sort a word in mysql..
(if we use ORDERED BY clause we can get output as Desc/Asc order .but i need to sort the word like bcad--->abcd
 
Tapas Chand
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not think MySql support this feature built in.
May be you have to create a stored function for this and write your own logic to sort.
 
chamini prashakthi
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeh I think so...
I searched a lot.
but couldn't find anything related...
 
Dave Tolls
Ranch Hand
Posts: 2369
25
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is it you are trying to do?

I can't think of any obvious situation where you would want to change the data in a column like that.
 
Liutauras Vilda
Marshal
Posts: 3399
131
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chamini prashakthi wrote:How can we sort a word in mysql..
(if we use ORDERED BY clause we can get output as Desc/Asc order .but i need to sort the word like bcad--->abcd
Sounds like a modifying of a record. Is it something permanently needs to be done?

Can't records be inserted into db already sorted in the way you want? Can't they be sorted once they are pulled out from db?

Just trying to pull more of a story out of you, same as Dave.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!