Home Sql Sql-functions Mysql Lpad Function



Mysql Lpad Function
Posted on: January 16, 2009 at 12:00 AM
Mysql Lpad Function is used to add padding to the left end of the string.The Function stopped the combination of string and added padding if it reached the length character.

Mysql Lpad Function

     

Mysql Lpad Function is used to add padding to the left end of the string.The Function stopped the combination of string and added padding if it reached the length character. Incase the string is shorter than the length,the string will be shortened from the left and will go with the specified length constraint.The padding can be any character.

Understand with example

The Tutorial understand an example from 'Mysql Lpad Function'.To understand this example we use the given below syntax:

SYNTAX:- LPAD(str,len,padstr)

Query to use Lpad Function:-

The Query below return you the all the letters of roseindia.net and are padded with  2 # to the left of the LPAD.

 

 

 

mysql> select LPAD('Roseindia.net',15,'#')as LPAD;

Output:-

+-----------------+
| LPAD            |
+-----------------+
| ##Roseindia.net |
+-----------------+
1 row in set (0.00 sec)

 

Related Tags for Mysql Lpad Function:
sqlmysqlcstringcomfunctionfuniosedcharpaddinglengthcharacterifunccteaddnattostopeachtopbieitusepeddeleftinaddinaddingmtrddadfuncendpppadcombinationbinsataddedracmyishaeaandaractstrssriringthstatindonombomo


More Tutorials from this section

Ask Questions?    Discuss: Mysql Lpad Function  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.