How to write a query to find all tables in a db that have a specific column name I've got a database with about 100 tables and I need to build a join query to get specific data from two of them.  I know one but not the other.  Basically I need something like:

select &lt;tables&gt; from &lt;database&gt; where exists table.column name;

How can I do this?
Using information_schema

This is the standards-compliant cross-RDBMS way to do it.

SELECT table_catalog, table_schema, table_name, column_name
FROM INFORMATION_SCHEMA.columns
WHERE column_name = '&lt;your column name&gt;';


You can see this documented


PostgreSQL
SQL Server
MySQL 8.0