MySQL Learning 4 Data filtering

Source: Internet
Author: User

And and OR operators

Cases

Select Prod_name, Prod_price

Form Products

where vend_id =1002 or vend_id=1003 and Prod_price >=10; #这样会先处理 and part of the content, and then process or the content

Example 2

Select Prod_name, Prod_price

Form Products

Where (vend_id =1002 or vend_id=1003) and Prod_price >=10;

In operator

Select Prod_name, Prod_price

Form Products

where vend_id in (1002,1003) #会与括号中的值逐个匹配, the actual effect is the same as where vend_id = 1002 or vend_id=1003

Order BY Prod_name;

Not operator

The NOT operator is the negation of any subsequent condition

Select Prod_name, Prod_price

Form Products

where vend_id not in (1002,1003)

Order BY Prod_name;

MySQL Learning 4 Data filtering

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.