SHOW TABLES statement with multiple LIKE values

后端 未结 4 1571
天涯浪人
天涯浪人 2020-12-24 07:09
mysql> SHOW TABLES like \'cms\';
+-------------------------+
| Tables_in_tianyan (cms) |
+-------------------------+
| cms                     |
+------------------------         


        
4条回答
  •  一整个雨季
    2020-12-24 07:33

    You need to use the WHERE clause. As shown in the docs, you can only have a single pattern if you use "SHOW TABLES LIKE ...", but you can use an expression in the WHERE clause if you use "SHOW TABLES WHERE ...". Since you want an expression, you need to use the WHERE clause.

    SHOW TABLES
    FROM ``
    WHERE 
        `Tables_in_` LIKE '%cms%'
        OR `Tables_in_` LIKE '%role%';
    

提交回复
热议问题