傳統的排序方法,比如select * from tableA order by id desc可以對英文、數字進行排序。但是遇到中文就沒有辦法了。這個時候需要以下的語句:
select * from tableA order by convert(name using gbk) collate gbk_chinese_ci desc。這個時候就可以對name進行排序,排序規則是按照中文的首字母進行排序。
傳統的排序方法,比如select * from tableA order by id desc可以對英文、數字進行排序。但是遇到中文就沒有辦法了。這個時候需要以下的語句:
select * from tableA order by convert(name using gbk) collate gbk_chinese_ci desc。這個時候就可以對name進行排序,排序規則是按照中文的首字母進行排序。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。