MySQL语句中
SELECT COUNT(*) FROM information_schema.TABLES WHERE table_name ='查询的表名';
存储过程中
DECLARE tableExists INT DEFAULT 0;
SELECT COUNT(*) INTO tableExists FROM INFORMATION_SCHEMA.TABLES WHERE table_name = '查询的表名';
IF tableExists > 0 THEN
-- 表存在
ELSE
-- 表不存在
END IF;