I want to insert values based on below code to a temporary table in postgresql
declare @output table (AuditScratchID bigint, AuditID bigint);
merge table atb
using (select
s.ID
....
....
....
from @temporaryTableVariable s
inner join ....
...............
..............
) as s
on 1 = 2 -- Impossible Condition so they never match
when not matched then
insert (.....)
values (.....)
output s.ID, inserted.ID
into @output;
Just to mention, how can I correlate values into temporary table
insert into ... select from temp_tablein the end?on 1 = 2 -- Impossible Condition so they never matchinsert into .. select from ...?