Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all i have a script below:
table 1:
id value
a 10
b 15
c 20
table 2:
id category
a xyz
b
Desired output is as :
final:
id value category
b 15
script is :
test:
load id, value from table 1;
left join
load id, category from table 2;
final:
load id, category, value resident test where isnull(category);
the output i get is:
id value category
b 15
c 20
please help how to get Desired output
thanks in advance
Replace the left join with an inner join (or right join)
test:
load id, value from table 1;
INNER join
load id, category from table 2;
//Use the below script to get the desired output
table1:
LOAD * INLINE [
id,value
a, 10
b,15
c,20
];
table2:
LOAD * INLINE [
id,category
a,xyz
b
];
RIGHT JOIN (table1)
LOAD *
RESIDENT table2
WHERE category='';
DROP TABLE table2;
Try this
Table1:
LOAD * INLINE [
id, value
a, 10
b, 15
c, 20
];
Inner Join
Table_2:
LOAD * INLINE [
id,category
a,xyz
b
]Where category='';