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.

1
  • 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. stackoverflow.com/help/how-to-ask Commented Sep 27, 2018 at 17:07

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.