2022-07-29 489
mysql怎么查询数据表是否存在
如何使用SQL查询语句,判断数据库和数据表是否存在?
1、判断数据库是否存在
查询SQL如下:
select * from information_schema.SCHEMATA where SCHEMA_NAME = '需要查找的数据库名';
也可以模糊查询,SQL如下:
select * from information_schema.SCHEMATA where SCHEMA_NAME like '%需要查询的数据库名的部分名称%';
2、判断数据表是否存在
查询SQL如下:
select * from information_schema.TABLES where TABLE_NAME = '需要查询的数据表名';
也可以模糊查询,SQL如下:
select * from information_schema.TABLES where TABLE_NAME like '%需要查询的数据表名的部分名称%';
原文链接:https://77isp.com/post/2328.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态