有没有办法检查另一个数据集中存在一个数据集中的哪些列? SQL
例如,我有表1和表2,有没有一种方法可以检查表2中的表1中的哪些列?谢谢!
For example, I have table 1 and table 2, is there a way I can check the which columns from table 1 exist in table 2? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然最好的解决方案将是特定于RDBMS(您尚未指示),但大多数数据库支持的A enstry 方法是使用 inovery_schema 视图,例如列出表1中的表1中的列名:
While the best solutions will be RDBMS specific (which you have not indicated), a general way that's supported by most databases is to use the information_schema views, for example the following will list the column names in table1 that are also in table2: