Home > Database > Mysql Tutorial > How to query who ends with mysql

How to query who ends with mysql

藏色散人
Release: 2020-10-26 15:33:57
Original
5292 people have browsed it

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 '%正';
Copy after login

2: Use the left function :

SELECT * FROM `article`
  where right(title,1)='正';
Copy after login

3: Use string interception function:

SELECT * FROM `article`
  where substring(title,-1)='正';
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template