标签:倒数 sub lld and 关键字 记录 amp highlight ring
SELECT a.AuxiliaryName, a.AuxiliaryDetailId, b.AuxiliaryName FROM `Finance_VoucherBillDetail` a INNER JOIN Finance_VoucherAuxiliary b ON a.AuxiliaryDetailId = b.AuxiliaryDetailId WHERE a.AuxiliaryDetailId <> ‘0‘ AND b.AuxiliaryName <> (SELECT SUBSTRING_INDEX( a.AuxiliaryName, ‘&‘, -1))
可以用在sql中进行字段内容的截取,我是用来做比较的判断。
SELECT SUBSTRING_INDEX的用法:
substring_index(被截取字段,关键字,关键字出现的次数)
例:select substring_index(a.AuxiliaryName,"&",-1)
结果:a.AuxiliaryName中‘&’后面的部分。
(注:如果关键字出现的次数是负数 如-2 则是从后倒数,到字符串结束)
标签:倒数 sub lld and 关键字 记录 amp highlight ring
原文地址:https://www.cnblogs.com/yuanbuyuan/p/12218851.html