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
background Basic Concepts CSS filter property app...
Table of contents Docker image download Start mys...
In the project (nodejs), multiple data need to be...
To use Nginx under Windows, we need to master som...
today select * from table name where to_days(time...
Table of contents 1. Use object to create an obje...
Search online to delete duplicate data and keep t...
I believe that everyone needs to reinstall MySQL ...
Table of contents Docker Compose usage scenarios ...
Sometimes we save a lot of duplicate data in the ...
Table of contents JS Three Mountains Synchronous ...
Table of contents 1. Basic configuration of Nginx...
The detailed installation process of mysql5.7.21 ...
Table of contents Components - Timeline Custom no...
The MySQL slow query log is very useful for track...