- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to find tables with a specific column name in MySQL?
To find column names, use information_schema.columns. Following is the syntax −
select distinct table_name from information_schema.columns where column_name like '%yourSearchValue%' and table_schema=database();
Let us implement the above syntax in order to find column names across various table. Here, we want only table names with a specific column name word “Client” −
mysql> select distinct table_name from information_schema.columns where column_name like '%Client%' and table_schema=database();
This will produce the following output −
+----------------+ | table_name | +----------------+ | demotable449 | | demotable450 | | demotable461 | | demotable517 | | demotable529 | | demotable534 | | demotable537 | | demotable543 | | demotable547 | +----------------+ 9 rows in set (1.19 sec)
Now, let us check any of the table and look for word with “Client” column name −
Advertisements