LOCATE(substr,str,pos) : LOCATE : String Functions MySQL TUTORIALS


MySQL TUTORIALS » String Functions » LOCATE »

 

LOCATE(substr,str,pos)


Returns the position of the first occurrence of substring substr in string str, starting at position pos.

Returns 0 if substr is not in str.

POSITION(substr IN str) is a synonym for LOCATE(substr,str).

mysql>
mysql> SELECT LOCATE('bar', 'foobarbar', 5);
+-------------------------------+
| LOCATE('bar', 'foobarbar', 5|
+-------------------------------+
|                             |
+-------------------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo String Functions
» LOCATE