📜  mysql 定位 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:10.661000             🧑  作者: Mango

代码示例1
/*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;