I have 2 tables:
Citytable – columnsCityID,Name,PeriodAssetstable – columnsAssetID,Name
I have to update the Period column of the City table with AssetID of the Assets table matching with the top 1 where City.Name=Assets.Name. The Assets table have identical names for different assets.
Example Assets table:
AssetID Name
1 Asset1
2 Asset1
3 Asset2
4 Asset2
How can I do this? I tried with different queries but I am not able to get it.
1 Answer