Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
SB2021
Contributor
Contributor

where not exist

The below code will have an extra row on ID E  with value 8 .

 By using where not exist this row should not be loaded.  I want to know why it will load. I have a hypothesis but not sure about that.

 

T1:
LOAD * Inline [

ID, brand, value
A , abc , 5
B, XYZ , 6
C , XYZ , 7
C , abc, 8
];

T2:
load ID1 as ID ,brand , value ;

LOAD * Inline [

ID1 , brand , value
A , abc , 500
B, pqr , 6
E , XYZ, 70000
E , abc , 8// will be loaded why?
]   where not Exists(ID,ID1 ) ;

Labels (1)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

ID1 has not been renamed to ID, so the value 'E' does not exist in filed ID and both records are loaded. If you move the test to 

T2:

Load ID1 as ID, brand, value

where not Exists (ID,ID1);

you will get the results that you expect.

View solution in original post

1 Reply
jwjackso
Specialist III
Specialist III

ID1 has not been renamed to ID, so the value 'E' does not exist in filed ID and both records are loaded. If you move the test to 

T2:

Load ID1 as ID, brand, value

where not Exists (ID,ID1);

you will get the results that you expect.