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: 2020-06-22T12:24:08+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements