07-27-2023, 12:26 PM
```
select distinct table_name
from information_schema.columns
where column_name in ('ColumnA')
and table_schema='YourDatabase';
and table_name in
(
select distinct table_name
from information_schema.columns
where column_name in ('ColumnB')
and table_schema='YourDatabase';
);
```
That ^^ will get the tables with ColumnA *and* ColumnB instead of ColumnA *or* ColumnB like the accepted answer
select distinct table_name
from information_schema.columns
where column_name in ('ColumnA')
and table_schema='YourDatabase';
and table_name in
(
select distinct table_name
from information_schema.columns
where column_name in ('ColumnB')
and table_schema='YourDatabase';
);
```
That ^^ will get the tables with ColumnA *and* ColumnB instead of ColumnA *or* ColumnB like the accepted answer