I am working on complicated problem, but I will simplify it to this problem.
I have two tables
A [ID, column1, column2, column3]
B [ID, column1, column2, column3, column4]
C [ID, column1, column2,column3]
I am creating another third table using this query.
UPDATE C
set column1=t.firstTab, column2=t.secondTab, column3=t.thirdTab
from (select A.column1 as firstTab, B.column2 as secTab,
(A.column1 + B.column2) thirdTab
from A, B limit 1; ) as t ;
I got: UPDATE 0
when I run this query:
select A.column1 as firstTab, B.column2 as secTab, (A.column1 + B.column2) thirdTab
from A, B limit 1;
I got results.
update
rather than acreate table
statement).