Sample Header Ad - 728x90

How to format a phone number in a SELECT statement?

5 votes
6 answers
24951 views
I have a database with table name student. I would like to display the register_number and phone_number of the student. The phone_number should be in the following format: +91-123-456-7890 and if the phone_number is NULL, then it should display N/A. The table looks like: R_NO | STUDENT_NAME | PHONE_NUMBER ------------------------------------------------------- 1 | Rajesh | 9632545123 2 | Sridevi | 9512647359 3 | Shiva | 9632155862 4 | HariHaran | 8426911231 5 | Ravi | 9111558899 6 | Pauline | NULL
Asked by user94804 (51 rep)
May 17, 2016, 04:07 PM
Last activity: Nov 25, 2024, 06:18 PM