![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I can select the records easily: select phone from employee where phone like "(909)222-%' but how do I update all the records in one T-SQL statement? I don't think I can use % in my update statement? update employee set substring(phone,6,3)='333' where phone like "(909)222-%' |
#3
| |||
| |||
|
|
Hi, I need to update the phone numbers in a table. if the first 7 numbers are "(909)222-", I need to change them to "(909)333-", regardless what the last 4 numbers are. I can select the records easily: select phone from employee where phone like "(909)222-%' but how do I update all the records in one T-SQL statement? I don't think I can use % in my update statement? Thank you in advance. |
#4
| |||
| |||
|
|
Eddie wang wrote: I can select the records easily: select phone from employee where phone like "(909)222-%' but how do I update all the records in one T-SQL statement? I don't think I can use % in my update statement? update employee set substring(phone,6,3)='333' where phone like "(909)222-%' or update employee set substring(phone,locate(phone,'222-'),3)='333' where phone like "(909)222-%' bk |
![]() |
| Thread Tools | |
| Display Modes | |
| |