知道一个字段名,怎样查到它在数据库里的哪张表里,mysql

2024-12-05 03:57:51
推荐回答(2个)
回答1:

USE Information_schema;
SELECT TABLE_NAME FROM COLUMNS WHERE COLUMN_NAME='字段名称';

回答2:

SQL Server语句
select a.name as TableName,b.name as ColumnsName
from sysobjects a, syscolumns b where b.name='rankid' and a.id=b.id

b.name=字段名