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
My machine environment: Windows 2008 R2 MySQL 5.6...
Preface While browsing GitHub today, I found this...
This article mainly introduces the ::master pseud...
The powerful tool cgroup in the kernel can not on...
Preface Before talking about covering index, we m...
I have been using CSS for a long time, but I have...
Table of contents 1. Job Execution Fault Toleranc...
Preface In many management and office systems, tr...
This article shares with you the graphic tutorial...
The MySQL built-in date function TIMESTAMPDIFF ca...
The error "mysql is not an internal command&...
Table of contents Partitioning mechanism SELECT q...
1. Docker ps lists containers 2. Docker cp copies...
Table of contents 1. Lvs Introduction 2. Lvs load...
1. What is In react applications, event names are...