
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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)
- Related Questions & Answers
- Update multiple values in a table with MySQL IF Statement
- How to fetch fields with multiple values set using MySQL LIKE?
- Insert multiple sets of values in a single statement with MySQL?
- How we have multiple stored GENERATED COLUMNS in MySQL table with CREATE TABLE statement?
- MySQL If statement with multiple conditions?
- Multiple LIKE Operators with ORDER BY in MySQL?
- How can we have multiple virtuals GENERATED COLUMNS in MySQL table with CREATE TABLE statement?
- Use LIKE % to fetch multiple values in a single MySQL query
- MySQL query to display records from a table filtered using LIKE with multiple words?
- Insert multiple values in a temporary table with a single MySQL query?
- Display specific table names with MySQL LIKE Operator
- Show a MySQL user-defined variables values in the result table?
- How to use MySQL LIKE clause to fetch multiple values beginning with “Joh”
- Create a temporary table similar to a regular table with MySQL LIKE
- How can we update columns values on multiple rows with a single MySQL UPDATE statement?
Advertisements