MySQL Null value

Source: Internet
Author: User

we've seen the SQL SELECT command use with the WHERE clause to extract data from the MySQL table, but when we try to give a condition that the comparison field or column value is set to NULL, it does not work correctly. To handle this situation, MySQL provides three large operators is NULL: If the value of the column is null, the result of the operation returns True is  not NULL: If the value of the column is not NULL, the result of the operation returns True<=>: operator comparison value, (different from=operator) Even if two null values it returns true the condition that involves null is special. Cannot be used=NULL or!=NULL to match the null value of the lookup column. Such comparisons always fail because it is impossible to tell if they are true. EvenNULL = NULLis also a failure. The value of the lookup column is or is not NULL, using is NULL or is not NULL. To find the record in which the value of the Tutorial_count column is or is not NULL, the query should write: MySQL> SELECT *  fromTcount_tbl - WHERETutorial_count is NULL;+-----------------+----------------+|Tutorial_author|Tutorial_count|+-----------------+----------------+|Mahnaz|           NULL ||Jen|           NULL |+-----------------+----------------+2Rowsinch Set(0.00sec) MySQL> SELECT *  fromTcount_tbl - WHERETutorial_count is  not NULL;+-----------------+----------------+|Tutorial_author|Tutorial_count|+-----------------+----------------+|Mahran|              - ||Gill|              - |+-----------------+----------------+2Rowsinch Set(0.00Sec

MySQL Null value

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.