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.
The Tutorial understand an example from 'Mysql Lpad Function'. To understand this example we use the given below syntax:
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;
+-----------------+ | LPAD | +-----------------+ | ##Roseindia.net | +-----------------+ 1 row in set (0.00 sec)
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: January 17, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles