查詢mysql id序列,Mysql字符串中有數(shù)字的排序問題?
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)
根據(jù)實際情況看吧
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)
根據(jù)實際情況看吧