SQL for ordering by number - 1,2,3,4 etc instead of 1,10,11,12

前端 未结 8 2331
清歌不尽
清歌不尽 2020-11-30 19:13

I’m attempting to order by a number column in my database which has values 1-999

When I use

ORDER_BY registration_no ASC

I get….

8条回答
  •  孤街浪徒
    2020-11-30 19:49

    This problem is just because you have declared the column in CHAR, VARCHAR or TEXT datatype. Just change the datatype to INT, BIGINT etc. This is will solved the problem of your custom ordering.

提交回复
热议问题