
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
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