MySQL Forums
Forum List  »  MySQL Query Browser

Re: Select query with GROUP condition thens order by alphanumeric
Posted by: Chad Bourque
Date: December 10, 2009 10:20PM

Chu,

I think you are going to have to write a function that takes a string and returns a string. In that function, iterate the string, and translate each character into another character that will sort how you want. I would think this would be slower than you'd like, too, but I can't think of another way since the various characters can be anywhere in the string.

If you have to have that special sorting, I would probably add another column to the table for the sort value and do the translation I mentioned above on insert and update triggers, populating that new column. Then, you could just order by that column.

HTH,
Chad

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.