test_string

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

select * from test order by test_string asc

排序結果:1,10,11,2,3,4,5,6,7,8,9

select * from test order by CAST(test_string AS UNSIGNED) asc

排序結果:1,2,3,4,5,6,7,8,9,10,11

Leave a comment

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *