First, let's briefly introduce wildcards, special characters used to match part of a value. Wildcards are a supplement to operators. Operators are confirmed, while wildcards are fuzzy. Here are a few examples: % Wildcard: SELECT * FROM products WHERE products.prod_name LIKE 'jet%' This % means that any preceding character appears any number of times. This example uses the search Case Sensitivity Depending on how Let's look at another example account: SELECT * FROM products WHERE products.prod_name LIKE '%anvil%' The above means that any Again, here is another example: SELECT * FROM products WHERE products.prod_name LIKE 's%e' This means that all It is important to note that Note Trailing spaces Trailing spaces may interfere with wildcard matching. For example, in the save word
Another useful wildcard character is the underscore SELECT * FROM products WHERE products.prod_name LIKE '_ ton anvil' The Unlike As you can see, Don't overuse wildcards. If other operators can achieve the same purpose, you should use other operators. When you do need to use wildcards, don't use them at the beginning of a search pattern unless absolutely necessary. Placing the wildcard at the beginning of the search pattern is the slowest search. This is the end of this article about MySQL wildcards (SQL advanced filtering). For more relevant MySQL wildcard content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Eight hook functions in the Vue life cycle camera
>>: canvas.toDataURL image/png error handling method recommendation
This article shares the specific code of Vue to i...
Table of contents 1. Introduction to binlog 2. Bi...
Table of contents Preface 1. unknown vs any 2. Th...
1. First check whether the system has mysql insta...
1 / Copy the web project files directly to the we...
This article mainly discusses the differences bet...
[LeetCode] 175.Combine Two Tables Table: Person +...
Initially, multiple columns have different conten...
We may have a question: After we install MySQL lo...
Recently, the company has put forward a requireme...
Recently, the company purchased a DELL R730 serve...
Table of contents 1. Component Registration 2. Us...
1. To build a PPTP VPN, you need to open port 172...
About Docker Swarm Docker Swarm consists of two p...
Table of contents 1. The role of array: 2. Defini...