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
Table of contents 1. How to view the binary data ...
Effect To implement HTML, first prepare a clean H...
Many friends have asked in forums and message are...
Tables once played a very important role in web p...
Features of MySQL: MySQL is a relational database...
Sttty is a common command for changing and printi...
Table of contents Precautions Necessary condition...
Configure web page compression to save resources ...
Hello everyone, today I will share with you the W...
This article analyzes the process of shutting dow...
Table of contents background Provide / Inject Ext...
Table of contents 1. Description 2. Installation ...
1. Use the SELECT clause to query multiple tables...
In HTML and CSS, we want to set the color of a bu...
Preface Recently, a Java EE web project that has ...