- 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
How MySQL SUM() function evaluates if it got the column, having character data type, as its argument?
MySQL SUM() function will return 0, rather than NULL, along with a warning on getting the character type column as its argument. Following example using data from table named ‘Social’ will illustrate it −
Example
mysql> Select * from Social; +------+-------+ | Id | Name | +------+-------+ | 100 | Rahul | +------+-------+ 1 row in set (0.00 sec) mysql> Select SUM(Name) From Social; +-----------+ | SUM(Name) | +-----------+ | 0 | +-----------+ 1 row in set, 1 warning (0.00 sec)
- Related Articles
- How MySQL SUM() function evaluates if the column having NULL values too?
- What would be the output of MySQL SUM() function if a column having no values has been passed as its argument?
- How MySQL evaluates if I store date along with time value in a column having DATE data type?
- How MySQL stored function evaluates if it got NULL value while using the dynamic values from a table?
- How MySQL evaluates if I will use an expression within SUM() function?
- How MySQL SUM() function evaluates if it is used with SELECT statement that returns no matching rows?
- How to insert NULL keyword as a value in a character type column of MySQL table having NOT NULL constraint?
- What MySQL COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- How MySQL evaluates when I use a conditional expression within SUM() function?
- How can I use a SELECT statement as an argument of MySQL IF() function?
- What happens if we provide NULL as an argument to MySQL CHAR() function?
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- How can we use MySQL SUM() function with HAVING clause?
- How to pass Python function as a function argument?

Advertisements