Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
I need a explanation on exist() function. I had searched and saw the exist function. But am not getting clear view on this. So, can you please clearly explain this.
It would be very helpful to me.
Regards,
Ramana.
Can you tell whether you are looking for exit statement or function?
HI Sir,
I need exist() function
where exist() and where not exist()...I need a clear view on this..
below for where Exists
Table1:
Load * inline [
column1
a
b
c
d
];
Table2:
Load * inline [
column2
a
b
] where Exists(column1,column2);
drop table Table1;
below code for not exist
Table1:
Load * inline [
column1
a
b
c
d
];
Table2:
Load * inline [
column2
a
b
e
f
] where not Exists(column1,column2);
drop table Table1;
let me know if any Q's
Hi,
Assume this example for Exists
LOAD * Inline [
ITEM,classes
1
2
12
14 ];
LOAD * Inline [
ITEMID,class
1
2
3
0
10
11
12 ] Where Exists(ITEM,ITEMID);
Means in ItemId you get only that id which match in the Item field
You Get in
And for Where NOT Exists
LOAD * Inline [
ITEM,classes
1
2
12
14 ];
LOAD * Inline [
ITEMID,class
1
2
3
0
10
11
12 ] Where Not Exists(ITEM,ITEMID);
And difference you get
Means in ItemId you get only that id which not match in the Item field
Regards
Anand
@ Anand,
in both cases of yours its need to drop first table then only we could find record which exists and not exists from first table
other wise it will give you all record in first table and existing record from second and
all record in first table and not existing record from second
hope this make sense
Thank you now i got clarity....
Mark it correct or helpful for suitable answer .so that post is closed.
Sunil,
Thats right intentionally i not drop the table for get values of the first and then second table to get values. But for final result we need to drop the Table one at the end of the table load for both case like.
T1:
LOAD * Inline [
ITEM,classes
1
2
12
14 ];
T2:
LOAD * Inline [
ITEMID,class
1
2
3
0
10
11
12 ] Where Exists(ITEM,ITEMID);
Drop Table T1;
Regards
Anand