SELECT LPAD('plus2net',13,'**');
The output is here
*****plus2net
You can see we have plus2net of 8 characters long. To this we have added or Pad at left ( at starting ) so the resultant string is of total 13 chars length.
SELECT LPAD('plus2net',2,'**');
The output is here
pl
This is first two chars of our input sting only.
select rpad('plus2net',15,'*')
The output is here plus2net*******
SELECT rpad( 'plus2net', 15, 'abc' )
Output of this is plus2netabcabca
SELECT rpad( 'plus2net', 5, 'abc' )
Output will be plus2 ( Up to 5 char only )
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.