locate in mysql code example Example 1: locate sql server SELECT CHARINDEX('b','ab') //returns 2 Example 2: mysql string position POSITION(substr IN str)