If you load your second table from a SQL server using a SQL SELECT, and your first (SharePoint) table LOAD comes before, then do this:
First in the SharePoint LOAD, create a duplicate of the ID column and call it TempID. YMMV as I do not really know how you load information from SharePoint.
ID AS TempID,
Then add a simple Preceding LOAD in front of the SQL SELECT for Table 2 like this:
LOAD * WHERE Exists(TempID, ID);
SQL SELECT ...;
Finally drop the TempID field using a statement like this:
DROP Field TempID;
That should do it.
Thanks for the suggestions, Use the Preceding LOAD (Where Exists) in front of the SQL SELECT worked! But the problem is, filter all these IDs while loading from SQL took more time than load all the registers from the database (I have more than 40.000 unique IDs). I Would like to exclude the Orphaned ID in table 2 just after load all the table 2. Load a copy of the table 2 with the Where Exist(TempID, ID) and drop table 2 i think could be a solution, but there is another one more efficient way?
LOAD ID, Date as Date1
(html, codepage is 1252, embedded labels, table is @1);
LOAD ID, Date as Date2
(html, codepage is 1252, embedded labels, table is @2);
Right Keep (t2)
load ID Resident t1;