Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: updating data


Message #1 by hmatarai@y... on Wed, 9 Jan 2002 06:09:30
Hanako,
Try this:
****************************************************
CREATE TABLE #Phones (ID integer, Num varchar(20))
INSERT INTO #Phones VALUES (1,'(111)236-1111')
INSERT INTO #Phones  VALUES(2,'(111)910-5689')
INSERT INTO #Phones  VALUES(3,'(111)111-9874')
INSERT INTO #Phones  VALUES(4,'(111)555-1111')
INSERT INTO #Phones  VALUES(5,'(111)321-1111')
INSERT INTO #Phones  VALUES(6,'(555)555-2222')
INSERT INTO #Phones  VALUES(7,'(555)555-5555')

select * from #Phones

update #Phones
set Num =  substring(num,2,3)+'-' + right(Num,8)
	
go
select * from #Phones
****************************************************
Good luck.
	Eva

-----Original Message-----
From: hmatarai@y... [mailto:hmatarai@y...]
Sent: Wednesday, January 09, 2002 1:10 AM
To: sql language
Subject: [sql_language] updating data


Advertise on P2P or become an official list sponsor.

Would you like your message to reach as many as 36,000 
professionals? Or 92,000? Or maybe even 1 million? 
Contact us (verag@w...) for more information on 
banner, button and newsletter advertising.
---
Hi,

I am trying to update phone and fax # in our database. Currently the all 
phone/fax numbers are like (555)555-5555, but I want to change them like 
555-555-5555. How should I do it?
Thanks for your response

Hanako

  Return to Index