当前位置: 移动技术网 > IT编程>数据库>Mysql > mysql之locate(substr, str [, pos])

mysql之locate(substr, str [, pos])

2019年04月19日  | 移动技术网IT编程  | 我要评论

locate(substr, str [, pos])

返回在pos位置之后,substr在str中出现的位置。若substr在str的pos位置之后没有出现,则返回0。

select locate('bing', 'wubinggo')    # ->3
select locate('bing', 'wubinggl', 2)
# ->3,不是3-2=1
select locate('bing', 'wubinggo', 3)
# ->0

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网