• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

Removing special characters from column

How would I remove special charaters (/) from my fname column. the position of these characters are not predictable. I would like to have Space instead of this character in my table.
the records are somthing like this
'X/YZ'
'AB/C'
Please suggest.
0
parpaa
Asked:
parpaa
  • 2
1 Solution
 
CluskittCommented:
UPDATE table
SET fname=REPLACE(fname,"/","")
WHERE fname LIKE '%/%'
0
 
CluskittCommented:
Or you can even drop the where part. It will simply update all records, regardless of having a / or not. When it doesn't, it updates to the same value, though.
0
 
ThomasianCommented:
SELECT REPLACE(fname, '/', ' ') FROM tablename

Open in new window


OR to replace the values permanently:

UPDATE tablename SET fname = REPLACE(fname, '/', ' ') WHERE fname LIKE '%/%'

Open in new window

0
 
parpaaAuthor Commented:
Thanks very much
It worked perfectly
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now