how to add new character in existing values?

Last Post 24 Feb 2005 07:37 AM by nosepicker. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
samkry
New Member
New Member

--
23 Feb 2005 09:30 PM
Hi..
How can i use sql statement to add additional character in existing values, I want the first character to be replaced with new character..
example: 123456 contains 6 char so I want replace it by 223456 also contains 6 char
nosepicker
New Member
New Member

--
24 Feb 2005 07:37 AM
If you know that you always want to replace a specific character with another specific character (like if you always want to replace the number 1 with the number 2), then you can use REPLACE. Even though I can't tell for sure what rules you want to use for replacing your text, it seems like the STUFF function will work better for you. The STUFF function allows you to replace characters based on their character position within the string. So if you want to replace the first character of a string with something else, regardless of what is in that first position, then use STUFF. If your substitution rules are more complicated than that, you might have to use a combination of functions.
You are not authorized to post a reply.

Acceptable Use Policy