我想检查一个表是否在数据库中。那么检查表是否在数据库中的MySQL查询是什么?
答案 0 :(得分:1)
SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'MyDataBase'
答案 1 :(得分:1)
您应该尝试使用 database_name和table_name ..
SELECT count(*)
FROM information_schema.tables
WHERE table_schema = 'db_name'
AND table_name = 'table_name'
如果存在,则将返回1 <0>
答案 2 :(得分:0)
SELECT count(*) FROM information_schema.TABLES where TABLE_SCHEMA='dbname' and table_name='tblname'