Alphanumeric Order By in Mysql

前端 未结 4 1073
感情败类
感情败类 2020-12-20 00:29

How can i make only numeric order by when the column containing alphanumeric characters in mysql ?

column (name) is unique field.

my table contains the recor

4条回答
  •  感情败类
    2020-12-20 00:52

    I had a slightly different issue, but the second example worked for me. I'd vote it up, but I just got started here.

    I was dealing with a single varchar column which could contain any kind of information, but it needed to sort properly no matter what was in it:

    So my column could contain info such as:

    AB CD EF GH

    or

    01 02 03 04

    The answer from Xavier caused it to be in alphabetical order when the information was all alphabetical, or numeric when the info was numeric.

    Thanks

    Thanks!

提交回复
热议问题