Home  >  Article  >  Database  >  How to query who ends with mysql

How to query who ends with mysql

藏色散人
藏色散人Original
2020-10-26 09:44:005233browse

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';".

How to query who ends with mysql

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn