作者argon007 (我是强尼‧大门的球迷XDD)
看板Database
标题[SQL ] how to format the phone number in SQL Server 2005?
时间Fri May 30 07:20:06 2008
I have trouble with that.
like (###) ###-####.
from the homework.
"List the phone number from the authors table.
Format the phone number as left bracket followed by the area code followed by
the right bracket followed by the phone number."
I know that
SELECT phone
FROM author
however, the results will be like
408 496-7223
but I do not know how to format the phone number.
can you help me to figure it out please?
thanks.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 154.20.173.137
1F:推 ruby0104:select '('+left(phone,3)+')'+ 05/30 13:19
2F:→ argon007:thank you. 05/30 13:41