MySQL 'Order By' - sorting alphanumeric correctly

后端 未结 15 2295
执念已碎
执念已碎 2020-11-22 12:02

I want to sort the following data items in the order they are presented below (numbers 1-12):

1
2
3
4
5
6
7
8
9
10
11
12

However, my query - using

15条回答
  •  -上瘾入骨i
    2020-11-22 12:34

    This type of question has been asked previously.

    The type of sorting you are talking about is called "Natural Sorting". The data on which you want to do sort is alphanumeric. It would be better to create a new column for sorting.

    For further help check natural-sort-in-mysql

提交回复
热议问题