温馨提示×

MySQL查询数据库中没有主键的表

发布时间:2020-08-11 19:46:30 来源:ITPUB博客 阅读:490 作者:壹頁書 栏目:MySQL数据库

  1. select table_schema,table_name from information_schema.tables
  2. where (table_schema,table_name) not in(
  3.     select distinct table_schema,table_name from information_schema.columns where COLUMN_KEY='PRI'    
  4. )
  5. and table_schema not in (
  6.     'sys','mysql','information_schema','performance_schema'
  7. );

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。