Removing rows which contain data from another table

Hello,

I have 2 tables and I would like to remove rows from table 1 which contains rows from table 2. However, table 1 has an extra column which I would like to keep. The real data actually has quite a lot of columns and rows but the different between the 2 table is still the first column. I also need it to run in a reasonable timing. Any ideas how could I do it?

In the example on top, the rows with ID 1, 2, 5, 6 and 9 has data from the next 4 column which appear in table 2 and hence, was removed from table 1.

2 Likes

Hey @ToastyCheese

You can load it to the datatable and use Except linq function!

Thanks
#nK

1 Like

Check this link.

Hi

Thanks for the reply. I’ve done some read up and got the basic idea on how linq works, but however, I might still required some more reading to understand more to apply it for this case. Could I check, is it still possible to use it if I do not know the exact number of columns but I know that the difference between the 2 tables is always that table 1 has one more extra column than table 2, will always be the first column and all other columns are in the same order and have the same header.

1 Like