Home >Database >Mysql Tutorial >MySql获取某个字段存在于哪个表的sql语句

MySql获取某个字段存在于哪个表的sql语句

WBOY
WBOYOriginal
2016-06-07 16:17:091279browse

本文为大家详细介绍下通过MySql查询某个字段所在表是哪一个,具体的sql语句如下,感兴趣的朋友可以参考下,希望对大家有所帮助 复制代码 代码如下: SELECT TABLE_SCHEMA,TABLE_NAME FROM information_schema.`COLUMNS` WHERE COLUMN_NAME = 'col1' col1为子

本文为大家详细介绍下通过MySql查询某个字段所在表是哪一个,,具体的sql语句如下,感兴趣的朋友可以参考下,希望对大家有所帮助

 

复制代码 代码如下:


SELECT TABLE_SCHEMA,TABLE_NAME FROM information_schema.`COLUMNS` WHERE COLUMN_NAME = 'col1'


col1为子段名。

Statement:
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