Sorting/ordering in MySQL

前端 未结 3 1912
一生所求
一生所求 2021-01-14 05:26

I\'m having a little problem with trying to sort the contents of a table programs by the column prog_id which holds the id of each program in the f

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 06:10

    Not optimal solution -

    ...ORDER BY substring_index(prog_id, '.', 1), substring_index(substring_index(prog_id, '.', 2), '.', -1), substring_index(prog_id, '.', -1)
    

    Odd solution, but try it -

    ...ORDER BY INET_ATON(prog_id)
    

提交回复
热议问题