Answers for "remove special characters from string in mysql"

SQL
1

remove special characters mysql

usertable
+----+-----------+
| Id | Name      |
+----+-----------+
|  1 | $John     |
|  2 | $Carol    |
|  3 | $Mike     | 
|  4 | $Sam      |
|  5 | $Dav$id$  |
|  6 | Robert$   |
|  7 | J$ames$   |
|  8 | Max$well$ |
+----+-----------+
8 rows in set (0.00 sec)

#Update table by replacing "$" with "" (nothing).
update usertable
set Name=replace(Name,'$','');

Query OK, 8 rows affected (0.22 sec)
Rows matched: 8 Changed: 8 Warnings: 0

#Query table to confirm changes.
SELECT *
FROM usertable

+----+---------+
| Id | Name    |
+----+---------+
|  1 | John    |
|  2 | Carol   |
|  3 | Mike    |
|  4 | Sam     |
|  5 | David   |
|  6 | Robert  |
|  7 | James   |
|  8 | Maxwell |
+----+---------+
8 rows in set (0.00 sec)
Posted by: Guest on July-29-2021

Code answers related to "remove special characters from string in mysql"

Code answers related to "SQL"

Browse Popular Code Answers by Language