Answer

问题及解答

在数据库 math 中显示所有以 "ss_" 开头的数据表.

Posted by haifeng on 2018-10-31 07:56:57 last update 2018-10-31 08:20:16 | Edit | Answers (1)

(1) 在数据库 math 中显示所有以 "ss_" 开头的数据表.

(2) 显示所有以 "test_" 开头的数据库.

1

Posted by haifeng on 2018-10-31 08:21:43

(1)

mysql> SHOW TABLES LIKE "ss_%";
+--------------------------------+
| Tables_in_summer_school (ss_%) |
+--------------------------------+
| ss_comments                    |
+--------------------------------+
1 row in set (0.00 sec)

 

 

(2)

mysql> SHOW DATABASES LIKE "test_%";
+-------------------+
| Database (test_%) |
+-------------------+
| test_bar          |
| test_db3          |
| test_fruits       |
| test_my_first_db  |
| test_products     |
| test_transaction  |
| test_zero         |
+-------------------+
7 rows in set (0.01 sec)