MySQL 数据库查询某个表存不存在

SELECT
	count( * ) 
FROM
	INFORMATION_SCHEMA.TABLES 
WHERE
	table_schema = ( SELECT DATABASE ( ) ) 
	AND table_name = 'table_name' 
	AND table_type = 'BASE TABLE';
posted @ 2022-04-20 12:01  柒月廿三  阅读(32)  评论(0)    收藏  举报  来源