查找字段在数据库中的那个表 mysql

SELECT TABLE_SCHEMA,TABLE_NAME FROM information_schema.`COLUMNS`
WHERE COLUMN_NAME='字段名'


查找字段在数据库中的那个表 mysql

use information_schema;

select * from columns where column_name='字段名' ;

查找表字段和其注释

SELECT COLUMN_NAME,column_comment FROM INFORMATION_SCHEMA.Columns WHERE table_name='表名'

//查看字段重复

select order_id,count(*) as count from表名 group by order_id having count>1;

猜你喜欢

转载自1306577707.iteye.com/blog/2400729