In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces whether the mysql database supports like or not, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
Mysql supports like,like to vaguely match any multi-character match or any single character, which will be used in combination with "%" and "_"; for example, "% a" matches data ending in a, "% a%" matches data containing a, "_ a_" matches data with three digits and the middle letter is a, and so on.
Fuzzy query using Like in MySQL
The so-called "fuzzy query" corresponds to "precise query". For example, if we want to query whether a field value is equal to 1, we can write "where column=1" in the SQL statement, which is the exact query. Precise queries are easy to understand, but we often use fuzzy queries. For example, I want to look up a user from the user table, but I can't remember to clean up his name. I only know that there is a word "Hong" in his name. then the fuzzy query comes in handy.
Like matching / fuzzy matching, will be used in combination with% and _.
'% a' / / data ending with a' a%'/ / data starting with a'% a%'/ / containing three digits of a with the middle letter of'_ a'/ / two digits of an and ending with two digits of'a'/ / with the beginning of a
Query for information that begins with the java field.
SELECT * FROM position WHERE name LIKE 'java%'
Query information that contains the java field.
SELECT * FROM position WHERE name LIKE'% java%'
Query the information that ends with the java field.
SELECT * FROM position WHERE name LIKE'% java'; Thank you for reading this article carefully. I hope it will be helpful for everyone to share whether the mysql database supports like content. At the same time, I also hope that you will support it, pay attention to the industry information channel, and find out if you have any problems. Detailed solutions are waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.