1

My starting text is "BP" (2 characters) and I would like to adjust my text to 5 characters, like "000BP" or " BP" (3 spaces before BP).

1 Answer 1

1

Simple LPAD:

SELECT LPAD('BP', 5, '0')

SELECT LPAD('BP', 5, ' ')

DBFiddle Demo

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for this answer!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.