0

I'm trying to update one of my tables with data from another table. The tables have the same number of rows if that matters. However when I try to use UPDATE and SET in the below code, the column Flow in still has all null values.

UPDATE #temptableInfo
SET Flow = (SELECT xRFlow
FROM #temptableInfoPre)

Any help is appreciated.

Rab
  • 11
  • 2
  • Sample input? Table structure? What's the relationship between the 2 tables? No one can help you if we don't know these information. Read this. https://stackoverflow.com/help/how-to-ask – Eric Sep 27 '18 at 17:07

1 Answers1

0

Try to use update from-from construction if your tables could by joined on some key fields

update #temptable 
set val = B.val
from #temptable A
inner join another_table B on A.id = B.link_to_a_id
Alexey Usharovski
  • 1,404
  • 13
  • 31