通过 information_schema 的 TABLES 视图与 COLUMNS 进行关联查询:

mysql> 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', 'performance_schema');
-- By 许望(RHCA、OCM、VCP)
最后修改:2019 年 11 月 08 日 12 : 46 PM
如果觉得我的文章对你有用,请随意赞赏