0
点赞
收藏
分享

微信扫一扫

主键有无检测

雨鸣静声 2022-08-03 阅读 10

 

 

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

 


举报

相关推荐

0 条评论