Skip to content
Advertisement

Update multiple columns from a specific row in another table

I have seen examples of updating multiple rows from a join, but in this case there are more than one matching rows resulting from a join, I need a specific row (the earliest UpdatedDate row).

Example of the tables:

[Robot]

[RobotAuditTable]

I want to update the RobotName XA01 with the values(RobotName, RobotColor) from the earliest Updated Date row in the RobotAuditTable.

I have tried approaches with joins and subqueries but I cannot get the syntax and conditions correct.

Advertisement

Answer

You can use apply:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement