Home >Database >Mysql Tutorial >How to query who ends with mysql
How to query who ends with mysql: 1. Use wildcards, such as "like '%正';"; 2. Use the left function, such as "right(title,1)='positive';" "; 3. Use the string interception function, with statements such as "substring(title,-1)='positive';".
Recommended: "mysql video tutorial"
Mysql query statements ending with a certain character
To query data ending with a certain character, it is often used in Mysql. Commonly used statements are:
The following is an example of querying the statements whose article titles end with the word "正":
1: Use wildcards:
SELECT * FROM `article` where title like '%正';
2: Use the left function :
SELECT * FROM `article` where right(title,1)='正';
3: Use string interception function:
SELECT * FROM `article` where substring(title,-1)='正';
The above is the detailed content of How to query who ends with mysql. For more information, please follow other related articles on the PHP Chinese website!