原生的sql写法:
SELECT *
FROM br_esf_village_building
WHERE 1
ORDER BY CONVERT( `buildingName`
USING gbk )
COLLATE gbk_chinese_ci ASC
tp框架的写法:
$data = $this->where($where)->field($field)->order(‘CONVERT( `buildingName` USING gbk )COLLATE gbk_chinese_ci ASC‘)->select();
本文出自 “PHP/Linux@HeFei” 博客,请务必保留此出处http://liang3391.blog.51cto.com/178205/1871232
原文地址:http://liang3391.blog.51cto.com/178205/1871232