SELECT DISTINCT TABLE_NAME FROM information_schema.`COLUMNS` WHERE COLUMN_NAME = 'catid' AND TABLE_SCHEMA = 'mks_ue163_com' AND TABLE_NAME NOT LIKE 'vm%';
-- 通用模板 SELECT table_name FROM information_schema.TABLES WHERE table_schema = 'dbName' AND table_type = 'base table' AND TABLE_NAME NOT IN ( SELECT DISTINCT TABLE_NAME FROM information_schema.COLUMNS WHERE COLUMN_NAME = 'culumnName' AND TABLE_SCHEMA = 'dbName' AND TABLE_NAME NOT LIKE 'vw%' );
-- 例如:查询数据库【fengchen】中表里没有字段【id】的所有表 SELECT table_name FROM information_schema.`TABLES` WHERE TABLE_SCHEMA = 'fengchen' AND TABLE_TYPE = 'base table' AND TABLE_NAME NOT IN ( SELECT DISTINCT TABLE_NAME FROM information_schema.`COLUMNS` WHERE COLUMN_NAME = 'id' AND TABLE_SCHEMA = 'fengchen' AND TABLE_NAME NOT LIKE 'vm' )