您可以使用 GROUP BY 在单个查询中对多个条件执行多个 COUNT()。语法如下:SELECT yourColumnName, COUNT(*) from yourTableName group by yourColumnName;为了理解上述语法,让我们首先创建一个表。创建表的查询如下:mysql> create table MultipleCountDemo -> ( -> Id int, -> Name varchar(100), -> Age int -> ); ... 阅读更多
您可以使用 WHERE 子句和 OR 运算符来显示具有多个 LIKE 的表。语法如下:show table from yourDatabaseName where tables_in_yourDatabaseName Like ‘%anyTableName%’ or tables_in_yourDatabaseName Like ‘%anyTableName2%’ or tables_in_yourDatabaseName Like ‘%anyTableName3%’ . . . . or tables_in_yourDatabaseName Like ‘%anyTableNameN%’在上述语法中,只显示数据库中的表名。这里考虑数据库“test”和同一数据库中的表。显示具有多个 LIKE 的表的查询如下:mysql> show tables from test -> where tables_in_test like '%userrole%' -> or tables_in_test like '%view_student%' -> or tables_in_test like '%wholewordmatchdemo%';... 阅读更多