主键有无检测

 

 

select a.table_schema,a.table_name 

from information_schema.tables a left outer join information_schema.table_constraints b

on a.table_schema = b.table_schema and a.table_name = b.table_name and b.constraint_name in ('PRIMARY')

where b.table_name is null and a.table_schema not in ('information_schema','performance_schema','test','mysql', 'sys');

 

posted @ 2020-09-17 11:30  igoodful  阅读(110)  评论(0编辑  收藏  举报