Home > Database > Mysql Tutorial > How to check MySQL table from database based on specific column name?

How to check MySQL table from database based on specific column name?

PHPz
Release: 2023-09-06 18:17:12
forward
1244 people have browsed it

如何根据特定列名称从数据库中检查 MySQL 表?

The following statement shows a list of two tables with an "email" column in the sample database -

mysql> SELECT DISTINCT TABLE_NAME
    -> FROM INFORMATION_SCHEMA.COLUMNS
    -> WHERE COLUMN_NAME IN('EMAIL')
    -> AND TABLE_SCHEMA = 'SAMPLE';
+---------------+
| TABLE_NAME    |
+---------------+
| employee      |
| new_student   |
+---------------+
2 rows in set (0.04 sec)
Copy after login

The above is the detailed content of How to check MySQL table from database based on specific column name?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template