Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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; 
 
PREVIOUS NEXT
Tagged: #mysql #locate
ADD COMMENT
Topic
Name
1+2 =