Question about the mysql statement? Provide specific ideas

Source: Internet
Author: User
What are the questions about mysql statements? Provide specific ideas? There is a field in the database, such as strvalue (varchar), whose saved values are like: 1, 2, 5, 7, 2, 8, 9. 1. the value obtained from the web page is 1 or 9, & nbsp; do you have any questions about mysql statements when writing a select statement? Provide specific ideas?
There is a field in the database, such as strvalue (varchar). Its saved values are similar to:, or.


1. the value obtained from the webpage is 1 or 9,

Write a select statement to query the rows that meet the requirements of 1 or 5 in the database...

It seems that I can't use like. Can I use one sentence?
2. if the value obtained from the webpage (obtained by the check box) is 1, 2, or 8, 9,

Write a select statement to query the rows that meet 1, 2, or 8, 9 in the database...

------ Solution --------------------
Where strvalue link '% 100' or strvalue link' % 100'
------ Solution --------------------
Full-text index
------ Solution --------------------
SQL code
Where strvalue like '1, 2% 'or strvalue like' % 8, 9'

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.