How to find all the tables in MySQL with specific column names in them?

后端 未结 11 1053
天命终不由人
天命终不由人 2020-11-22 11:09

I have 2-3 different column names that I want to look up in the entire DB and list out all tables which have those columns. Any easy script?

11条回答
  •  渐次进展
    2020-11-22 11:30

    Use this one line query, replace desired_column_name by your column name.

    SELECT TABLE_NAME FROM information_schema.columns WHERE column_name = 'desired_column_name';
    

提交回复
热议问题