获取特定的几位:
1、取url字段后三位字符

select SUBSTRING(url, -3) from link;  

2、取url字段前三位字符

select SUBSTRING(url, 3) from link;  

配合模糊查询:模糊查询查询顶单后六位

<select />
from wx_order
where SUBSTRING(order_id, -6) like CONCAT('%',#{code},'%')
</select>

相关文章: