

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
What MySQL returns if we provide an empty string for padding with other string in LPAD() or RPAD() functions?
Suppose if we provide an empty string for padding on LPAD() or RPAD() functions then MySQL will return NULL as output. Following example will demonstrate it −
Example
mysql> Select LPAD('ABCD',22,''); +--------------------+ | LPAD('ABCD',22,'') | +--------------------+ | NULL | +--------------------+ 1 row in set (0.00 sec) mysql> Select RPAD('ABCD',22,''); +--------------------+ | RPAD('ABCD',22,'') | +--------------------+ | NULL | +--------------------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- What MySQL returns, if the length of the original string is greater than the length specified as an argument in LPAD() or RPAD() functions?
- What happens if the length of the original string is greater than the length of the string returned after padding in LPAD() or RPAD() functions?
- How can we use MySQL LPAD() and RPAD() functions in the same query for padding the string to both sides, left and right, of the original string?
- How can we use LPAD() or RPAD() functions with the values in the column of a MySQL table?
- What MySQL returns if we convert an empty hexadecimal value to a number?
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What MySQL ASCII() function returns if I will provide NULL to it?
- What MySQL returns if I provide a non-hexadecimal number as an argument to UNHEX() function?
- What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?
- What happens if we provide NULL as an argument to MySQL CHAR() function?
- What MySQL returns if the search string, provided in FIELD() function, is NULL?
- Checking for Null or Empty or White Space Only String in Java.
- Which one is better in MySQL - NULL or empty string?
- How can we stuff a string with another one using MySQL functions?
- MySQL query that returns a specific string if column is null?
Advertisements