MYSQL is required to filter data in Chapter 6 of Reading Notes. mysql is required.

Source: Internet
Author: User

MYSQL is required to filter data in Chapter 6 of Reading Notes. mysql is required.

Mysql Introduction

MySQL is an open-source Relational Database Management System (RDBMS). the MySQL database system uses the most common database management language-Structured Query Language (SQL) for database management.

When using both the order by and where clauses, the order by clause should be placed after the WHERE clause; otherwise, an error will occur.

1. mismatch check

Copy codeThe Code is as follows:
SELECT vend_id FROM products where vend_id <> 1003

Equivalent

Copy codeThe Code is as follows:
SELECT vend_id FROM products where vend_id! = 1003

2. Range check

To check the value of a range, you can use the BETWEEN operator. Its syntax is slightly different from the operators of other WHERE clauses, because it requires two values. Used to retrieve the price and date.

Copy codeThe Code is as follows:
SELECT prod_name, prod_price FROM products WHERE prod_price BETWEEN 5 AND 10;

3. Check for null values

NULL has no value. It is different from a field that contains 0, an empty string, or only a space.

Copy codeThe Code is as follows:
Select * from products
Where prod_price is Null;

The above is a small series to share with you the MYSQL will know the Reading Notes, chapter 6 of the filtering data content, I hope to help you!

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.