📜  postgresql 在所有表中搜索列名 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:00.794000             🧑  作者: Mango

代码示例2
select t.table_schema,
       t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name 
                                and c.table_schema = t.table_schema
where c.column_name = 'last_name'
      and t.table_schema not in ('information_schema', 'pg_catalog')
      and t.table_type = 'BASE TABLE'
order by t.table_schema;
Code has been copied