没有引用的 SQL 视图
我们在 SQL Server 2008 R2 中有一个包含 20 列的表 T
。四列是来自其他四个固定(ID,Value)
表的简单外键。
我们现在想要的就是创建一个新的 VIEW,并将 T
的四个 foreign-key-columns
替换为相应的 Values
。其余 16 列应保持不变。
请问,如何在SQL
中以最优雅的方式实现这一点?
We have in SQL Server 2008 R2 a table T
with 20 columns. Four columns are simple foreign keys from four other fixed (ID, Value)
tables.
All we want now, is to create a new VIEW with those four foreign-key-columns
of T
replaced by those corresponding Values
. 16 remaining columns should be untouched.
Please, how to achieve that in SQL
in the most elegant way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需连接 4 个相关表即可,没有快捷的方法;
Simply join the 4 related tables there isn't a shorthand way of doing it;