Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 特定表的SQL计数数_Mysql_Sql_Sql Server - Fatal编程技术网

Mysql 特定表的SQL计数数

Mysql 特定表的SQL计数数,mysql,sql,sql-server,Mysql,Sql,Sql Server,我有一个SQL数据库,其中包括几个表(如test1、test2等)。我想计算表名上带有spesific关键字的表的数量。例如,获取以关键字“test”开头的所有表。你知道我该怎么做吗?你可以使用信息\u模式。表格: select t.table_name, t.table_schema from information_schema.tables t where t.table_name like 'test%'; 请注意,这在MySQL和SQL Server中都有效

我有一个SQL数据库,其中包括几个表(如test1、test2等)。我想计算表名上带有spesific关键字的表的数量。例如,获取以关键字“test”开头的所有表。你知道我该怎么做吗?

你可以使用
信息\u模式。表格

select t.table_name, t.table_schema
from information_schema.tables t
where t.table_name like 'test%';
请注意,这在MySQL和SQL Server中都有效