"MySQL Must know" study _ the eighth chapter _20180730_ Huan

Source: Internet
Author: User

The eighth chapter studies like operator, hundred percent (%) wildcard character, underscore (_) wildcard

P47

Select Prod_id,prod_name from products where prod_name like ' jet% '; #表示检索prod_name列中的值 all words that start with Jet,% indicates that the following characters can be multiple or 0 # Note that the search for MySQL is case-sensitive, if differentiated, that jet and jet are not the same #

Select Prod_id,prod_name from products where prod_name like '%anvil%; #表示任何位置含有anvil, they can be retrieved.

P48

Select Prod_name from products where prod_name like ' s%e '; # indicates that the first bit of retrieval is s, and the last one is all the words of E #

P49 underscore (_) wildcard character

Select Prod_id,prod_name from products where prod_name like ' _ Ton anvil '; #_只能检索出单个字符 #

Select Prod_id,prod_name from products where prod_name like '% ton anvil '; #% can retrieve multiple characters #

Note: You can use the wildcard characters as much as possible with other commands, because wildcards are slower to execute.

"MySQL Must know" study _ the eighth chapter _20180730_ Huan

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.