Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 tables:
A:
ID | SEG | RESULT |
---|---|---|
3 | ||
12 | A | 1 |
13 | B | 1 |
14 | B | 1 |
B:
CLIENT_ID | MESURE |
---|---|
1 | |
13 | 1 |
I want to find as a result the difference between the 2 tables:
C:
ID | SEG | RESULT |
---|---|---|
3 | ||
12 | A | 1 |
14 | B | 1 |
Any help please?
Regards,
hello
what do you mean by difference ?
as I see, the keys are not the same in each table (ID,SEG for A, CLIENT_ID for B)
you could try a join on SEG=CLIENT_ID
and ion a 2nd pass create a flag if RESULT<>MESURE
May be like:
B:
Load * Inline [
CLIENT_ID, MESURE
,1
13, 1];
A:
Load * Inline [
ID, SEG,RESULT
, ,3
12, A, 1
13, B, 1
14, B, 1
] where not Exists(CLIENT_ID,ID) or len(trim(ID))=0;
Drop Table B;
Both have the same key, just when I wrote the exemple I made a mistake, Both have the same name : ID.
Regards
so you can join them using that key
tab:
load * from A;
join(tab)
load CLIENT_ID,MESURE
from B;
tab2:
load *,
if(RESULT<>MESURE,1,0) as flag_error
resident tab;
Loading Inline with a where-condition? Bold move.
Inline data load is here for non-availability of actual data source and trying to give the OP an idea.