LoginSignup
0
0

More than 3 years have passed since last update.

MySQLで特定のカラム名を持つテーブルを検索

Posted at

今回はメールアドレスがありそうなカラムを調べたかったので、likeで検索しました。
column_nameのところに検索したいカラムの名前、table_schemaはDB名です。

SELECT table_name, column_name FROM information_schema.columns WHERE column_name LIKE '%mail%' AND table_schema = 'hoge';
0
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
0
0