
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Output of NULL Value in Arithmetic Expression
As we know that a NULL is no value and it is not the same as zero. MySQL represents a database column as NULL if it does not contain any data. Now, if we will use NULL in any arithmetic expression then the result will be NULL also.
Example
mysql> Select 65/NULL,65+NULL,65*NULL,65-NULL,65%NULL; +---------+---------+---------+---------+---------+ | 65/NULL | 65+NULL | 65*NULL | 65-NULL | 65%NULL | +---------+---------+---------+---------+---------+ | NULL | NULL | NULL | NULL | NULL | +---------+---------+---------+---------+---------+ 1 row in set (0.00 sec)
From the above example, it can be observed that if we will use NULL in an arithmetic expression then the result would be NULL itself.
Advertisements