| Author |
Topic |
|
jmanresa
Starting Member
3 Posts |
Posted - 2009-06-18 : 06:12:55
|
| Hello I am a rookie. I need to remove the 'Sr' characters in a field of a table and I do not know how. I tested with: SELECT REPLACE (Name, 'Sr','') FROM ACPR And generates a view with the modified records as I want, but not updated in the table. Can I help you? Thanks in advance and best regards. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-06-18 : 06:24:41
|
update tableset name=REPLACE(Name, 'Sr','') where ... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-18 : 06:32:16
|
My neighbour "Askim Osram" would object to that!I don't think he likes to be called "Askim Oam".UPDATE Table1 SET Name = LTRIM(RTRIM(REPLACE(' ' + Name + ' ', ' Sr ', ' '))) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
jmanresa
Starting Member
3 Posts |
Posted - 2009-06-18 : 07:13:15
|
Thank you very much my dear friend. Perfect and easyquote: Originally posted by webfred update tableset name=REPLACE(Name, 'Sr','') where ... No, you're never too old to Yak'n'Roll if you're too young to die.
|
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-18 : 08:37:57
|
Didn't you see the danger in using the first suggestion, as described in my post? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-18 : 08:39:33
|
quote: Originally posted by jmanresa Thank you very much my dear friend. Perfect and easyquote: Originally posted by webfred update tableset name=REPLACE(Name, 'Sr','') where ... No, you're never too old to Yak'n'Roll if you're too young to die.
Did you see Peso's reply?MadhivananFailing to plan is Planning to fail |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-06-18 : 08:51:13
|
quote: Originally posted by jmanresa Thank you very much my dear friend. Perfect and easyquote: Originally posted by webfred update tableset name=REPLACE(Name, 'Sr','') where ... No, you're never too old to Yak'n'Roll if you're too young to die.
Not very perfect for all cases See Peso's correction! No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
jmanresa
Starting Member
3 Posts |
Posted - 2009-06-18 : 09:59:03
|
Yes you're right. But in this case to remove the characters are 'Sr.' and in this case it is impossible that there is a word that contains Sr. I will try your solution if I do well there. Thank you very much for your help. Greetingsquote: Originally posted by Peso Didn't you see the danger in using the first suggestion, as described in my post? E 12°55'05.63"N 56°04'39.26"
|
 |
|
|
|