Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Table A:
Artid, ArtLev, Vlgnr
658 | ABC | 1 |
658 | BCA | 2 |
658 | DGE | 3 |
659 | ABB | 2 |
659 | BBE | 3 |
670 | FHG | 1 |
In table A 'Artid' has multiple values sorted by 'Vlgnr'. But sometimes Vlngr 1 of 2 doesn't exist but 3,4,5 etc do.
I want to load ArtLev where Vlgnr = 1, if 1 doesn't exists i want to load 2.
Can anyone help?
May be just this
Table:
LOAD * INLINE [
Artid, ArtLev, Vlgnr
658, ABC, 1
658, BCA, 2
658, DGE, 3
659, ABB, 2
659, BBE, 3
670, FHG, 1
];
Right Join (Table)
LOAD Artid,
Min(Vlgnr) as Vlgnr
Resident Table
Group By Artid;
May be just this
Table:
LOAD * INLINE [
Artid, ArtLev, Vlgnr
658, ABC, 1
658, BCA, 2
658, DGE, 3
659, ABB, 2
659, BBE, 3
670, FHG, 1
];
Right Join (Table)
LOAD Artid,
Min(Vlgnr) as Vlgnr
Resident Table
Group By Artid;