Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sort an element in mysql  RSS feed

 
chamini prashakthi
Ranch Hand
Posts: 125
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: 125
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
Rancher
Posts: 2914
36
  • 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: 4650
318
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!