Like means "like" in Chinese, but when applied to MySQL database, Like is a statement used for fuzzy query, mainly for character fields, to retrieve the corresponding substring in a character field column. This article introduces the Like statement in MySQL. 1. What does Like mean?1. Like is considered a predicate in MySQL, and its application is similar to the usage of symbols such as is, =, >, and <. 2. In the SQL structured query language, the like statement plays a vital role. 3. In a sense, Like can be seen as a streamlined regular expression function. 2. Like functionThe syntax of the like statement is select * from table name where field name like corresponding value (substring) Function: Mainly for character fields, to search for corresponding substrings in a character field column. 3. Like Support TypesLike mainly supports two wildcard characters, "_" and "%". 1. "_" represents matching one arbitrary character and is often used as a placeholder; 2. "%" means matching 0 or more arbitrary characters. 4. Two usage scenarios of Like1. The field values stored in the database are more accurate, and the parameters are fuzzy values (this is usually the case); 2. The field values stored in the database are fuzzy values, and the parameters are more precise values. Knowledge point expansion: In MySQL, the SQL mode is case-insensitive by default. Some examples are shown below. Note that when you use SQL mode, you cannot use = or ! =; use the LIKE or NOT LIKE comparison operator. SELECT field FROM table WHERE a field Like condition Regarding conditions, SQL provides four matching modes: %: represents any one or more characters. Matches characters of any type and length. for example SELECT * FROM [user] WHERE u_name LIKE '%三%' This is the end of this article about the concept and usage of Like in MySQL. For more information about what Like means in MySQL, please search previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of several ways to remove the gap between inline-block elements in CSS
1. MYSQL index Index: A data structure that helps...
How to save and exit after editing a file in Linu...
Table of contents plan Install Dependencies Intro...
Here are some points to note when registering Tom...
Six effectsImplementation Code html <h1>CSS...
Compared with the old life cycle Three hooks are ...
The main symptom of the conflict is that the FLASH...
Table of contents Impact of full table scan on th...
Table of contents A simple component example More...
Preface In daily code development, there are many...
Table of contents Routing Manager background gett...
Table of contents 1. Recipe Collection 1.1 Projec...
When you are working on a shared system, you prob...
Table of contents 1. Download MySQL 1.1 Download ...
Nginx does not support nested if statements, nor ...