doubleyong
管理员
管理员
  • 最后登录2025-12-02
  • 发帖数1198
  • 最爱沙发
  • 喜欢达人
  • 原创写手
  • 社区居民
  • 忠实会员
阅读:7089回复:0

MYSQL 类似于的 INDEXOF 用法

楼主#
更多 发布于:2017-08-31 14:07
from http://peter2009.iteye.com/blog/1181789
LOCATE(substr,str)
 
返回子串substr在字符串str第一个出现的位置,如果substr不是在str里面,返回0.
mysql> select LOCATE('bar', 'foobarbar');  
-> 4  
mysql> select LOCATE('xbar', 'foobar');  
-> 0  

原文:http://blog.csdn.net/u012307002/article/details/20718381
知识需要管理,知识需要分享
游客


返回顶部

公众号

公众号