
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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 Articles
- Update multiple values in a table with MySQL IF Statement
- 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?
- How to fetch fields with multiple values set using MySQL LIKE?
- How can we have multiple virtuals GENERATED COLUMNS in MySQL table with CREATE TABLE statement?
- MySQL If statement with multiple conditions?
- Insert multiple values in a temporary table with a single MySQL query?
- How to use MySQL LIKE clause to fetch multiple values beginning with “Joh”
- Multiple LIKE Operators with ORDER BY in MySQL?
- 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?
- How can we update columns values on multiple rows with a single MySQL UPDATE statement?
- Show a MySQL user-defined variables values in the result table?
- Display specific table names with MySQL LIKE Operator
- Update with multiple values in MySQL WHERE clause

Advertisements