Mysql query no primary key table

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');

  

Guess you like

Origin www.cnblogs.com/hanglinux/p/12534294.html