Duplicate records are inserting by using insert_recordset

Hi, Everyone.

I have a condition, Which are records are not in the table2 in table1 those things only could be inserted.

Initally Table2 does not have any records, so I ran the job it works as fine after that I have update one more records in table1 and again I ran the job its getting duplicat records

Please find screenshots fyi, kindly suggest where I am deviated …

Occur duplicate records:

Thanks in advance,

You condition isn’t correct, because tab3 isn’t a part of the query selecting data. I think you need something like this:

Table2 tab2;
Table3 tab3;
Table3 tabToInsert;

insert_recordset tabToInsert(Id, Name)
	select Id, Name from tab2
	    notexists join tab3
		where tab3.Id == tab2.Id;