1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MySQLのSHOW TABLESでテーブルを絞り込む

Last updated at Posted at 2023-09-20

基本的にDBはターミナルから見てるんだけど、
今までそこまで大規模なテーブル数のシステムをあまりやってなかったのもあり、
絞り込めることを知らなかった…。
公式ドキュメントは細かく読んでおいた方が作業効率が良くなるね…。

手順

テーブル名一覧の取得。

mysql> show tables;
+------------------------------------------------------+
| Tables_in_mydb                                       |
+------------------------------------------------------+
| a_table                                              |
| b_table                                              |
+------------------------------------------------------+

LIKE句で絞り込み。

mysql> show tables like 'b%';
b_table

テーブル名指定。

mysql> show tables where Tables_in_mydb ='a_table';
a_table

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?