1. 程式人生 > >mysql排序的中文首字母排序和自定義排序

mysql排序的中文首字母排序和自定義排序

二級 and gbk order by 首字母 order 排序 sql排序 code

select
		*
		FROM organ_new
		where city_code = ‘SZ0755‘ and organ_type =
		‘H‘ and state = ‘1‘
		ORDER BY 
                FIELD(organ_category,‘三級‘,‘二級‘,‘一級‘) ,#自定義排序
                CONVERT(organ_name USING gbk) COLLATE  #中文首字母排序
		gbk_chinese_ci DESC                 

  

mysql排序的中文首字母排序和自定義排序