- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
When a MySQL arithmetic expression returns NULL?
As we know that a NULL is not a value and it is also not the same as zero. MySQL arithmetic expression returns NULL if we will use NULL in it. It can be understood with the help of the following example −
Example
mysql> Select 100*NULL; +----------+ | 100*NULL | +----------+ | NULL | +----------+ 1 row in set (0.00 sec) mysql> Select 100+NULL; +----------+ | 100+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.
- Related Articles
- When MySQL IN() function returns NULL?
- When MySQL MAKE_SET() function returns NULL?
- When MySQL FIND_IN_SET() function returns NULL as output?
- When MySQL LOCATE() function returns NULL as the output?
- What MySQL returns when we use DISTINCT clause with the column having multiple NULL values?
- MySQL query that returns a specific string if column is null?
- What would be the output if we use a NULL value in an arithmetic expression?
- How can I set 0 if a query returns a null value in MySQL?
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL ASCII() function returns if I will provide NULL to it?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- Return null for date_format when input is null in MySQL?
- What MySQL returns if the search string, provided in FIELD() function, is NULL?
- What MySQL COUNT() function returns if there are some NULL values stored in a column also?

Advertisements