How can we escape special characters in MySQL statement?


Sometimes we need to include special characters in a character string and at that time they must be escaped or protected. We need to pursue some basic rules for escaping special characters which are given below −

The escape character (\) can be escaped as (\)

Example

mysql> Select 'A\B';
+-----+
| A\B |
+-----+
| A\B |
+-----+
1 row in set (0.00 sec)

Updated on: 22-Jun-2020

805 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements