我有两个这样的表:
Application
ApplicationID ApplicationDesc VersionNo
1 APP1 1
2 APP2 1
3 APP3 1
4 APP1 2
5 APP2 2
6 APP1 3
Order
OrderID ApplicationID OrderDescription
1 1 Belongs to APP1 version 1
2 4 Belongs to APP1 version 2
3 6 Belongs to APP1 version 3
我想用相应应用程序的最新版本的 ApplicationID 更新表 Order 中的 ApplicationID 列。
我希望数据看起来像这样:
Order
OrderID ApplicationID OrderDescription
1 6 Belongs to APP1 version 1
2 6 Belongs to APP1 version 2
3 6 Belongs to APP1 version 3
我该如何做到这一点?请帮忙。