If our project is to be migrated from Oracle to Mysql, but the instr function of MySQL can only find whether the child string is in the parent string, it cannot be searched according to the number of occurrences.Here I wrote one for migration. Of
INSTR (STR,SUBSTR) searches for the specified character (SUBSTR) in a string (STR) and returns the position (INDEX) of the specified character;STR is searched for the string subs;tr the string you want to searchIn the string str, the first position (
Oralce functions substr and mysql functions substring_index note ???? Recently, I occasionally saw the substring_index function in the mysql database. First, I would like to briefly introduce the substring_index function of mysql .???
Usage:
INSTR (Ori_str, SUB_STR)
MySQL INSTR () finds the position of a string in another string, returning the index value of the first occurrence.
Example:1.
The code is as follows
Copy Code
Mysql> Select InStr ('
Generally, the entire string is used as the operation object, for example: search for a substring in a substring, obtain a substring, insert a substring at a certain position in the substring, and delete a substring.
Generally, the entire string is
String function string comparison function if the result length is greater than the maximum value of the max_allowed_packet system variable, the return value of the string value function is NULL. See section 7.5.2 "Adjust server Parameters ".
String
String functionsstring comparison functionsIf the length of the result is greater than the maximum value of the Max_allowed_packet system variable, the return value of the string value function is null. See section 7.5.2, "Tuning server parameters."
Generally, the entire string is used as the operation object, for example: search for a substring in a substring, obtain a substring, insert a substring at a certain position in the substring, and delete a substring. The required and sufficient
MySQL stored procedure SP explanation
1. Introduction to stored procedures
The commonly used Operating Database Language SQL statements must be compiled and then executed before execution. the Stored Procedure (Stored Procedure) is a set of SQL
A string or string (string) is a finite sequence consisting of 0 or more characters. Generally recorded as s= ' a1a2 an ' (n>=0). It is the data type that represents text in the programming language.
A string is usually used as an action object,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.