Skip to main content
1 of 4
egwene sedai
  • 2.4k
  • 16
  • 24

Slightly different from your approach, here I construct a new table by appending a column ("B") to ds, where the value is looked up from ds2 via ID:

lookup[x_] := Query[SelectFirst[#ID == x &], "B"]@ds2
SortBy["ID"]@ds[All, Append[#, "B" -> lookup[#ID]] &]

enter image description here

egwene sedai
  • 2.4k
  • 16
  • 24