How to search for ^ character in a MySQL table?


To search for ^ character, use the LIKE operator as in the below syntax −

select table_schema,table_name,column_name
 from information_schema.columns
 where column_name like '%^%';

Let us first create a table −

mysql> create table DemoTable1826
     (
     `^` varchar(20),
     Name varchar(20),
     `^Age` int
     );
Query OK, 0 rows affected (0.00 sec)

Here is the query to search for ^ character in a MySQL table

mysql> select table_schema,table_name,column_name
     from information_schema.columns
     where column_name like '%^%';

This will produce the following output −

+--------------+---------------+-------------+
| TABLE_SCHEMA | TABLE_NAME    | COLUMN_NAME |
+--------------+---------------+-------------+
| web          | demotable1826 | ^           |
| web          | demotable1826 | ^Age        |
+--------------+---------------+-------------+
2 rows in set (0.00 sec)

Updated on: 24-Dec-2019

329 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements