MYSQL分享:获取缺失主键表信息语句

页面导航:首页 > 数据库 > Mysql > MYSQL分享:获取缺失主键表信息语句

MYSQL分享:获取缺失主键表信息语句

来源: 作者: 时间:2016-02-21 09:46 【

MYSQL分享:获取缺失主键表信息语句[sql]SELECT a.`TABLE_SCHEMA` AS DB_NAME , a.`TABLE_NAME` , a.`TABLE_ROWS` ,a.`ENGINE` -- , a.* FROM information_schema.`TABLES` a LEFT JOIN inform...

MYSQL分享:获取缺失主键表信息语句
 
[sql] 
SELECT a.`TABLE_SCHEMA` AS DB_NAME , a.`TABLE_NAME` , a.`TABLE_ROWS` ,a.`ENGINE`  -- , a.*   
FROM   
information_schema.`TABLES` a  
LEFT JOIN  information_schema.`TABLE_CONSTRAINTS` b  
    ON a.`TABLE_NAME` = b.`TABLE_NAME` AND a.`TABLE_SCHEMA` = b.`TABLE_SCHEMA`   
WHERE b.`TABLE_SCHEMA` IS NULL   
AND a.`TABLE_TYPE` = 'BASE TABLE'  
AND a.`TABLE_SCHEMA` NOT IN ('information_schema','test','','performance_schema')  
ORDER BY DB_NAME ,a.`TABLE_ROWS` DESC ;  
 
Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<