1.position
POSITION()函数返回字符串中子字符串的位置。
用法:POSITION(substring in string)
让我们分析以上语法:
substring参数是您要查找的字符串
这个串参数是要搜索子字符串的字符串。
POSITION()函数返回一个整数,该整数表示子字符串在字符串中的位置。如果在字符串中未找到子字符串,则POSITION()函数将返回零(0)。如果子字符串或字符串参数为null,则返回null。
工作中遇到的例子:
select * from ybss_dw_ddjc
where 1=1
and zagldwbm in (select zagldwbm from ybss_sd_sydw where position('255' in kz_gagldwfl)>0)