- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- 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 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)
Advertisements