- 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
What MySQL ASCII() function returns if I will provide NULL to it?
In this case, the output of ASCII() function depends on the condition that whether we are providing NULL as a string or we are providing simply NULL to it. Following example will demonstrate the difference −
mysql> SELECT ASCII(null); +-------------+ | ASCII(null) | +-------------+ | NULL | +-------------+ 1 row in set (0.00 sec) mysql> SELECT ASCII('null'); +---------------+ | ASCII('null') | +---------------+ | 110 | +---------------+ 1 row in set (0.00 sec) mysql> Select ASCII(NULL); +-------------+ | ASCII(NULL) | +-------------+ | NULL | +-------------+ 1 row in set (0.00 sec) mysql> Select ASCII('NULL'); +---------------+ | ASCII('NULL') | +---------------+ | 78 | +---------------+ 1 row in set (0.00 sec)
As we can observe from the above result set that when we will provide NULL or null as a string, ASCII() function will return the number code of the first character i.e. number code of N in case of ‘NULL’ and number code of n in case of ‘null’, otherwise when we provide simply NULL then it returns NULL as output.
- Related Articles
- What will MySQL CHAR_LENGTH() function return if I provide NULL to it?
- What MySQL ASCII() function returns if no parameter is provided to it?
- What MySQL COALESCE() function returns if all the arguments provided to it are NULL?
- What MySQL returns if I provide a non-hexadecimal number as an argument to UNHEX() function?
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What happens if we provide NULL as an argument to MySQL CHAR() function?
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- When MySQL IN() function returns NULL?
- When MySQL MAKE_SET() function returns NULL?
- What MySQL COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- What MySQL returns if the search string, provided in FIELD() function, is NULL?
- What MySQL CHAR_LENGTH() function returns if no parameter is provided to it?
- When MySQL FIND_IN_SET() function returns NULL as output?

Advertisements