Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi felix,
so try:
TableC:
load columnB
resident tableB;
left join(TableC)
load columnA
resident tableA;
Hi Fabio,
thx for your suggestion! 2 bad it didn't work out for me...I think I didn't explain the problem well.
I thought Table A could be helpfully so I created that one in order to have all keys gathered in the load order.
Cheers
Felix
Sooo sorry in my last reply I mixed up TableA and B
must be:
I thought Table B could be helpfully so I created that one in order to have all keys gathered in the load order.
hope this explains it better...
Here's one way:
A:
LOAD * INLINE [
Field1
abcd
bcde
cdef
0001
defg
efgh
fghi
0002
];
B:
LOAD * INLINE [
Field2
0001
0002
];
C:
NOCONCATENATE
LOAD
recno() as Sequence
,Field1
RESIDENT A
;
LEFT JOIN (C)
LOAD
Sequence
,Field1
,if(exists(Field2,Field1),Field1,peek(Field2)) as Field2
RESIDENT C
ORDER BY Sequence DESC
;
INNER JOIN (C)
LOAD Sequence
RESIDENT C
WHERE Field1<>Field2
;
DROP FIELD
Sequence
;
DROP TABLES
A
,B
;
But if the only reason you had table B was to make it easier to identify the numeric values and sequence in table A, then B is completely unnecessary, and it is simpler to go straight from A to C:
A:
LOAD * INLINE [
Field1
abcd
bcde
cdef
0001
defg
efgh
fghi
0002
];
C:
NOCONCATENATE
LOAD
recno() as Sequence
,Field1
RESIDENT A
;
LEFT JOIN (C)
LOAD
Sequence
,Field1
,if(num(Field1),Field1,peek(Field2)) as Field2
RESIDENT C
ORDER BY Sequence DESC
;
INNER JOIN (C)
LOAD Sequence
RESIDENT C
WHERE Field1<>Field2
;
DROP FIELD Sequence;
DROP TABLE A;