 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
SHOW TABLE statement with multiple LIKE values in MySQL?
You can use WHERE clause and OR operator to show table with multiple LIKE. The syntax is as follows:
show table from yourDatabaseName where tables_in_yourDatabaseName Like ‘%anyTableName%’ or tables_in_yourDatabaseName Like ‘%anyTableName2%’ or tables_in_yourDatabaseName Like ‘%anyTableName3%’ . . . . or tables_in_yourDatabaseName Like ‘%anyTableNameN%’
In the above syntax, only the table name in the database is displayed.
Here the database ‘test’ and the tables in the same database is considered. The query to show tables with multiple LIKE is as follows -
mysql> show tables from test -> where tables_in_test like '%userrole%' -> or tables_in_test like '%view_student%' -> or tables_in_test like '%wholewordmatchdemo%';
The following is the output.
+--------------------+ | Tables_in_test | +--------------------+ | userrole | | view_student | | wholewordmatchdemo | +--------------------+ 3 rows in set (0.01 sec)
Advertisements
 