MySQL: OR in SHOW TABLES? I've just installed MySQL and wondering if SHOW TABLES output can be combined. Btw, I'm not a DBA, please be patient if this question doesn't make sense to you. I just want to know how SQL query works, and what not.

E.g.

mysql&gt; SHOW TABLES;
+---------------------------------------+
| Tables_in_information_schema          |
+---------------------------------------+
| CHARACTER_SETS                        | 
| COLLATIONS                            | 
| COLLATION_CHARACTER_SET_APPLICABILITY | 
| COLUMNS                               | 
| COLUMN_PRIVILEGES                     | 
| KEY_COLUMN_USAGE                      | 
| PROFILING                             | 
| ROUTINES                              | 
| SCHEMATA                              | 
| SCHEMA_PRIVILEGES                     | 
| STATISTICS                            | 
| TABLES                                | 
| TABLE_CONSTRAINTS                     | 
| TABLE_PRIVILEGES                      | 
| TRIGGERS                              | 
| USER_PRIVILEGES                       | 
| VIEWS                                 | 
+---------------------------------------+
17 rows in set (0.00 sec)

mysql&gt;


Certain column can be filtered with LIKE

mysql&gt; SHOW TABLES LIKE 'SCHEMATA';
+-----------------------------------------+
| Tables_in_information_schema (SCHEMATA) |
+-----------------------------------------+
| SCHEMATA                                | 
+-----------------------------------------+
1 row in set (0.00 sec)

mysql&gt; 


Instead of typing this one by one ...

mysql&gt; SHOW TABLES LIKE 'TABLES';  
+---------------------------------------+
| Tables_in_information_schema (TABLES) |
+---------------------------------------+
| TABLES                                | 
+---------------------------------------+
1 row in set (0.00 sec)

mysql&gt; 


I was wondering if SHOW TABLES output can be filtered with more than 1 parameter.

Probably something like SHOW TABLES LIKE 'SCHEMATA' or 'TABLES';, but this query doesn't work

Desired Output

+-----------------------------------------+
| Tables_in_information_schema            |
+-----------------------------------------+
| SCHEMATA                                | 
| TABLES                                  | 
+-----------------------------------------+


Update:

I've just noticed that SHOW TABLES also can be produced with SELECT statement

mysql&gt; SELECT TABLE_NAME FROM TABLES WHERE TABLE_SCHEMA = 'information_schema';            
+---------------------------------------+
| TABLE_NAME                            |
+---------------------------------------+
| CHARACTER_SETS                        | 
| COLLATIONS                            | 
| COLLATION_CHARACTER_SET_APPLICABILITY | 
| COLUMNS                               | 
| COLUMN_PRIVILEGES                     | 
| KEY_COLUMN_USAGE                      | 
| PROFILING                             | 
| ROUTINES                              | 
| SCHEMATA                              | 
| SCHEMA_PRIVILEGES                     | 
| STATISTICS                            | 
| TABLES                                | 
| TABLE_CONSTRAINTS                     | 
| TABLE_PRIVILEGES                      | 
| TRIGGERS                              | 
| USER_PRIVILEGES                       | 
| VIEWS                                 | 
+---------------------------------------+
17 rows in set (0.01 sec)

mysql&gt; 


Still didn't work

mysql&gt; SELECT TABLE_NAME FROM TABLES WHERE TABLE_SCHEMA = 'information_schema' and TABLE_NAME = 'SCHEMATA' or 'TABLES';             
+------------+
| TABLE_NAME |
+------------+
| SCHEMATA    | 
+------------+
1 row in set, 1 warning (0.00 sec)

mysql&gt;
SELECT TABLE_NAME 
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' 
  AND TABLE_NAME IN ('TABLES', 'SCHEMATA');


or, for example (6 tables will be shown)

SELECT TABLE_NAME 
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = 'INFORMATION_SCHEMA' 
  AND (    TABLE_NAME LIKE 'TABLE%'
        OR TABLE_NAME LIKE 'SCHEMA%' );