I have query like this:
SELECT o1.q_sum, c.q_sum FROM CTE1 c INNER JOIN #order o1 ON o1.col1=c1.col1
It works. I get c.q_sum different from null for every row, while o1.q_sum is null.
But if I write like this:
UPDATE o1 SET o1.q_sum=c.q_sum FROM CTE1 c INNER JOIN #order o1 ON o1.col1=c1.col1
id doesn't work. The all columns q_sum from temp table are still null. How is that possible?