Answers for "mysql locate"

SQL
1

mysql string position

POSITION(substr IN str)
Posted by: Guest on September-23-2020
0

mysql locate

/*return position of substring in string: 0 is no match, 1=start of string*/
SELECT LOCATE("world", "hello world"); 

/*will return position of bob in full_name, 
0 means no bob in full_name. 1 means full_name starts with bob */
SELECT LOCATE("bob", full_name) as bob_position from users;
Posted by: Guest on August-05-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language