Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Given a column name how can I find which tables in database contain that column?

  • Given a column name how can I find which tables in database contain that column ?

    or alternatively

  • How can I find that particular column exists for all tables in Database ?

Note: Kindly explain answers with Examples as that I get most knowledge from the answer.

Edit: I am using MySQL Database.

like image 528
Rachel Avatar asked Dec 02 '25 03:12

Rachel


1 Answers

SELECT * FROM information_schema.columns WHERE COLUMN_NAME = 'mycolumn'
like image 74
nickf Avatar answered Dec 04 '25 16:12

nickf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!