
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Manage Start Position in MySQL LOCATE Function
As we know that by default searching in LOCATE() function starts from beginning. We can manage the start position by giving an argument to specify the position from which we want to start the search in string. Following example will demonstrate it −
Example
mysql> Select LOCATE('good','Ram is a good boy. Is Ram a good boy?',11)As Result; +--------+ | Result | +--------+ | 29 | +--------+ 1 row in set (0.00 sec)
In the above example, we have given the value 11 as the argument for position. It means that MySQL will start searching from 11th position.
Advertisements