Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading only those records from one table, which are not present in another table

Hi Everyone,

I have two different tables say A and B, both are loaded . Both tables have similar fields but with different names. In table A, there is a field "Clients" and table B have a field "Customers". Now, I want to create another table C and load only those Clients from A, which are not present in a Customers field of B.

For eg:

Table A
Clients > John, Peter, Graham, James, Brook

Table B
Customers > John, Brook

Table C should have following names
Clients > Peter, Graham, James

Please also provide a link where I can look for such operations.

Best Regards.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

That may be as simple as

TableA:LOAD * INLINE [Customer, CodeA, 1000B, 2000C, 3000D, 4000E, 5000]; TableB:LOAD * INLINE [Client, NumberB, 2000D, 4000]; TableC:LOAD Customer AS Cust, Code AS CodRESIDENT TableA WHERE NOT EXISTS(Client, Customer);


The third table loads all records from previously loaded in TableA when the value in TableA.Customer doesn't exists in TableB.Client.

Hope that helps.

View solution in original post

4 Replies
ToniKautto
Employee
Employee

Miguel_Angel_Baeyens

Hello,

That may be as simple as

TableA:LOAD * INLINE [Customer, CodeA, 1000B, 2000C, 3000D, 4000E, 5000]; TableB:LOAD * INLINE [Client, NumberB, 2000D, 4000]; TableC:LOAD Customer AS Cust, Code AS CodRESIDENT TableA WHERE NOT EXISTS(Client, Customer);


The third table loads all records from previously loaded in TableA when the value in TableA.Customer doesn't exists in TableB.Client.

Hope that helps.

tresesco
MVP
MVP

Hi,

APPLYMAP function could be helpful for your case. have a look at it from HELP.

Regards, tresesco

Not applicable
Author

Thank you very much. It worked well for me.