简体   繁体   English

搜索数据库中包含特定列的所有表

[英]Searching all tables in database containing specific column

I am looking for a simple query to find all tables within a database that have a certain "id" column, confusing myself as not all the tables contain this "id"我正在寻找一个简单的查询来查找数据库中具有特定“id”列的所有表,这让我自己感到困惑,因为并非所有表都包含此“id”

Using INFORMATION_SCHEMA.COLUMNS :使用INFORMATION_SCHEMA.COLUMNS

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'id'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM