SQL - ORDER BY not working properly?

前端 未结 4 1457
别跟我提以往
别跟我提以往 2020-12-11 16:15

SELECT test_column FROM test_table ORDER BY test_column gives me this:

1   
12  
123  
2  
3

Why not:

1
2
         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 16:42

    Check if the type of the column is varchar or something similar. Looks like it is being ordered by string value, not by numeric value. If the column only contains numbers it should better be of type int.

提交回复
热议问题