Mysql鎸夋眽瀛楅瀛楁瘝鎺掑簭

濡傛灉鏁版嵁搴撹〃瀛楁鐨勫瓧绗︾紪鐮佹槸latin1_swedish_ci

select * from tablename order by birary(name) asc ;

濡傛灉鏁版嵁搴撹〃瀛楁鐨勫瓧绗︾紪鐮佹槸utf8_general_ci

select * from tablename WHERE 1=1 order by CONVERT( name USING gbk ) COLLATE gbk_chinese_ci ASC

瀵筺ame瀛楁杩涜gbk缂栫爜锛岀劧鍚庯紝瀵圭紪鐮佸悗鐨勫唴瀹规牴鎹甮bk_chinese_ci杩涜鏁寸悊鎺掑簭銆傝繖鏍峰緱鍒扮殑缁撴灉锛岃嫳鏂囨槸鎺掑湪涓枃鍓嶉潰鐨勶紝鑰屼笖鏄牴鎹嫾闊虫帓搴忕殑銆�

你可能感兴趣的:(Mysql鎸夋眽瀛楅瀛楁瘝鎺掑簭)