我有一个包含超过90个表的数据库,我试图确定它们中的哪些(如果有的话)具有相同的两个特定列.我正在寻找的代码是这样的:
SHOW TABLES IN `database` 
      WHERE column = 'columnA' 
        AND column = 'columnB';`
这甚至可能吗?
这将为您提供具有两列中任何一列的所有表格,您可以浏览这些表格以查找所需内容.
  select *
    from information_schema.columns
   where column_name in ('columnA', 'columnB')
order by table_name, column_Name