- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why in MySQL, we cannot use arithmetic operators like ‘=’, ‘<’ or ‘<>’ with NULL?
The reason behind it is that we will not receive any meaningful results from the comparisons when we use NULL with the comparison operators like ‘=’, ‘<’ or ‘<>’. Consider the following example which demonstrates this concept −
mysql> Select 10 = NULL, 10< NULL, 10<>NULL; +-----------+----------+----------+ | 10 = NULL | 10< NULL | 10<>NULL | +-----------+----------+----------+ | NULL | NULL | NULL | +-----------+----------+----------+ 1 row in set (0.07 sec)
The above result set is not meaningful in any sense.
Advertisements