Replacing numerical value with “x” or “$” in between/end in MySQL

For the 7 question, you may use RIGHT:

SELECT CONCAT('xxxxxx', RIGHT(number, 4)) AS phone_number
FROM yourTable;

For the 8 question, consider this:

SELECT CONCAT('$$$', SUBSTR(number, 4, 4), '$$$') AS phone_number
FROM yourTable;

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top