Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to create the table below using the load in a table resident. please help me.
tab 1
| a | b | c |
| 1 | 201101 | 201101 |
| 5 | 201101 | 201102 |
| 4 | 201102 | 201102 |
tab2
| d |
| 201101 |
| 201102 |
| 201103 |
I need...
result
tab c
| e | sum |
| 201101 | 1 |
| 201102 | 4 |
| 201103 | 0 |
select sum(tab1.a), tab2.d
from tab1, tab2
where tab1.b <= tab2.c or tab1.c is null
but i need in the resident table
The following script works for me to get the result you want.
Tab1:
load * Inline [
a,b,c
1,201101,201101
5,201101,201102
4,201102,201102
];
Tab2:
LOAD *, d as e;
LOAD * Inline [
d
201101
201102
201103
];
Left Join (Tab2) LOAD b as d, c as e,a Resident Tab1;
DROP Table Tab1;
DROP Field d From Tab2;
The following script works for me to get the result you want.
Tab1:
load * Inline [
a,b,c
1,201101,201101
5,201101,201102
4,201102,201102
];
Tab2:
LOAD *, d as e;
LOAD * Inline [
d
201101
201102
201103
];
Left Join (Tab2) LOAD b as d, c as e,a Resident Tab1;
DROP Table Tab1;
DROP Field d From Tab2;
The logic is great, thanks very much.