Loading

查询mysql没有主键的表

select table_schema, table_name
  from information_schema.tables
 where table_name not in (select distinct table_name
                            from information_schema.columns
                           where column_key = "PRI")
   AND table_schema not in
       ('mysql', 'information_schema', 'sys', 'performation_schema');

  

posted @ 2020-03-20 19:43  李行行  阅读(3402)  评论(0编辑  收藏  举报