from http://peter2009.iteye.com/blog/1181789

LOCATE(substr,str) 

  
返回子串substr在字符串str第一个出现的位置,如果substr不是在str里面,返回0. 
Sql代码   收藏代码
  1. mysql> select LOCATE('bar''foobarbar');  
  2. -> 4  
  3. mysql> select LOCATE('xbar''foobar');  
  4. -> 0   
Logo

更多推荐