mysql查詢加排序,Mysql字符串中有數字的排序問題?
SELECT id, col,LENGTH(col) FROM d ORDER BY LENGTH(col) ASC, col ASC
或者
SELECT id,col FROM d ORDER BY CAST(TRIM('中文' FROM col) AS SIGNED)
根據實際情況看吧
SELECT id, col,LENGTH(col) FROM d ORDER BY LENGTH(col) ASC, col ASC
或者
SELECT id,col FROM d ORDER BY CAST(TRIM('中文' FROM col) AS SIGNED)
根據實際情況看吧