Learning PHP and MySQL

Example 08-10 Adding the formatting to a phone number using LEFT, RIGHT, and SUBSTR

SELECT CONCAT('('LEFT('6128238193',3),
')'SUBSTR('6128238193',4,3),
'-',
RIGHT('6128238193'4));

Posted by on 08/07 at 05:15 PM

Next entry: Example 08-11 Using WEEKDAY to get the day of the week

Previous entry: Example 08-08 Using TRIM with the TRAILING option

<< Back to main