I have three tables:
Table-1: Column1 | Column2 | Column 3
Table-2: Column4 | Column5 | ColumnUpdate
Table-3: Column7 | Column8
I need to copy some rows from Table-2 to Table-3 based on some conditions with Table-1:
My insert-statement looks like this:
INSERT INTO Table-3 (
Column7,
Column8)
SELECT Table-2.COLUMN4, Table-2.COLUMN5
FROM Table-2 INNER JOIN Table-1
ON Table-2.COLUMN4 = TABLE-1.Column1;
However I want to update column: ColumnUpdate" (Table-2) of the selecting row to "1".
So I select some rows and immediately want to update a process column in that row as '1'.
I don't know how to do that. I saw some examples with "OUTPUT" clause or "UPDATE FOR" but I dont exactly know how to use them in my statement.