Today I discovered that on my production database the field name
of some record also contains  
, so there are thousands of record that contains in name
field this type of structure: Mamurrasi vs. Internacional Tirana
So I am wondering if I can remove
from this record without damage the database.
For find it I used: SELECT * FROM venue WHERE name LIKE "% %"`
You can use replace:
update venue
set name = trim(replace(name, ' ', ' '))
where name like '% %';
This replace  
with a space and then removes unnecessary spaces from the beginning and end of the string.
 
is the html code for a non-breaking space. It makes more sense to replace it with a space than to to remove it entirely.
Assuming that this is Oracle and you want to replace ' '
by ' '
:
UPDATE venue v SET v.name = REPLACE(v.name, ' ', ' ');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.