MySql LOCATE() function

MySQL LOCATE() Function

Example

Search for "3" in string "W3Schools.com", and return position:
SELECT LOCATE("3""W3Schools.com"AS MatchPosition;
Try it Yourself »

Definition and Usage

The LOCATE() function returns the position of the first occurrence of a substring in a string.
If the substring is not found within the original string, this function returns 0.
This function performs a case-insensitive search.
Note: This function is equal to the POSITION() function.

Syntax

LOCATE(substringstringstart)

Comments

Post a Comment

Popular posts from this blog

Lab Network 2024

Step to publish your static html web page to GitHub

Tutorial OOP(reversion java)