
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How do I replace “+”(plus sign) with SPACE in MySQL?
To replace, use REPLACE() function from MySQL. Let us first create a table −
mysql> create table DemoTable ( Number varchar(100) ); Query OK, 0 rows affected (0.86 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('+916578675547'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('+918976676564'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('+919800087678'); Query OK, 1 row affected (0.12 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+---------------+ | Number | +---------------+ | +916578675547 | | +918976676564 | | +919800087678 | +---------------+ 3 rows in set (0.00 sec)
Following is the query to replace “+”(plus sign) with SPACE −
mysql> update DemoTable set Number=replace(Number, '+', ' '); Query OK, 3 rows affected (0.12 sec) Rows matched: 3 Changed: 3 Warnings: 0
Let us check the table records once again −
mysql> select *from DemoTable
This will produce the following output −
+---------------+ | Number | +---------------+ | 916578675547 | | 918976676564 | | 919800087678 | +---------------+ 3 rows in set (0.00 sec)
- Related Articles
- How to Add Plus Sign to Multiple Positive Numbers in Excel?
- Why do we use a plus sign in front of function name in JavaScript?
- Plus One in Python
- How do I use the @ sign in MySQL?
- LocalDateTime plus() method in Java
- Duration plus() method in Java
- LocalTime plus() method in Java
- Instant plus() method in Java
- LocalDate plus() method in Java
- Can someone explain to me what the plus sign is before the variables in JavaScript?
- MySQL query to insert current date plus specific time?
- Plus One Linked List in C++
- How Long Can I Expect to Live? Plus Other FAQs About Life Expectancy
- What is Unary Plus Operator in JavaScript?
- Cplus plus vs Java vs Python?

Advertisements