Greeting to all smart people around here !!
我遇到了一个关于SQL的怪异面试问题。
Qn。 If I have 100 tables in Database. I want to fetch common records from Each table.
例如,location
在100个表中是common字段。我想location
从所有表中获取字段而不在SQL查询中提及每个表名。
有什么办法吗?
如果有任何可能的话,请告诉我...
我的朋友找到了我问题的答案。
要从多个表中获取公共列,请使用INFORMATION_SCHEMA.COLUMNS和公共列名称。
询问 : select *from information_schema.columns where column_name='column name'
希望这会有所帮助!
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句